Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
0995eee8ffe4
Commit
0995eee8ffe4
authored
13 years ago
by
Stefano Tortarolo
Browse files
Options
Downloads
Patches
Plain Diff
rebase: add --tool argument for specifying merge tool
parent
3c43dd85d3d1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hgext/rebase.py
+11
-4
11 additions, 4 deletions
hgext/rebase.py
tests/test-rebase-parameters.t
+60
-0
60 additions, 0 deletions
tests/test-rebase-parameters.t
with
71 additions
and
4 deletions
hgext/rebase.py
+
11
−
4
View file @
0995eee8
...
...
@@ -114,6 +114,8 @@
if
srcf
or
basef
or
destf
:
raise
util
.
Abort
(
_
(
'
abort and continue do not allow specifying revisions
'
))
if
opts
.
get
(
'
tool
'
,
False
):
ui
.
warn
(
_
(
'
tool option will be ignored
\n
'
))
(
originalwd
,
target
,
state
,
skipped
,
collapsef
,
keepf
,
keepbranchesf
,
external
)
=
restorestatus
(
repo
)
...
...
@@ -167,10 +169,14 @@
if
len
(
repo
.
parents
())
==
2
:
repo
.
ui
.
debug
(
'
resuming interrupted rebase
\n
'
)
else
:
stats
=
rebasenode
(
repo
,
rev
,
p1
,
p2
,
state
)
if
stats
and
stats
[
3
]
>
0
:
raise
util
.
Abort
(
_
(
'
unresolved conflicts (see hg
'
'
resolve, then hg rebase --continue)
'
))
try
:
ui
.
setconfig
(
'
ui
'
,
'
forcemerge
'
,
opts
.
get
(
'
tool
'
,
''
))
stats
=
rebasenode
(
repo
,
rev
,
p1
,
p2
,
state
)
if
stats
and
stats
[
3
]
>
0
:
raise
util
.
Abort
(
_
(
'
unresolved conflicts (see hg
'
'
resolve, then hg rebase --continue)
'
))
finally
:
ui
.
setconfig
(
'
ui
'
,
'
forcemerge
'
,
''
)
updatedirstate
(
repo
,
rev
,
target
,
p2
)
if
not
collapsef
:
newrev
=
concludenode
(
repo
,
rev
,
p1
,
p2
,
extrafn
=
extrafn
)
...
...
@@ -592,6 +598,7 @@
(
''
,
'
keepbranches
'
,
False
,
_
(
'
keep original branch names
'
)),
(
''
,
'
detach
'
,
False
,
_
(
'
force detaching of source from its original
'
'
branch
'
)),
(
'
t
'
,
'
tool
'
,
''
,
_
(
'
specify merge tool
'
)),
(
'
c
'
,
'
continue
'
,
False
,
_
(
'
continue an interrupted rebase
'
)),
(
'
a
'
,
'
abort
'
,
False
,
_
(
'
abort an interrupted rebase
'
))]
+
templateopts
,
...
...
This diff is collapsed.
Click to expand it.
tests/test-rebase-parameters.t
+
60
−
0
View file @
0995eee8
...
...
@@ -330,3 +330,63 @@
$
cd
..
Test
--
tool
parameter:
$
hg
init
b
$
cd
b
$
echo
c1
>
c1
$
hg
ci
-
Am
c1
adding
c1
$
echo
c2
>
c2
$
hg
ci
-
Am
c2
adding
c2
$
hg
up
-
q 0
$
echo
c2b
>
c2
$
hg
ci
-
Am
c2b
adding
c2
created
new
head
$
cd
..
$
hg
clone
-
q -u
.
b
b1
$
cd
b1
$
hg
rebase
-
s 2 -d 1 --tool internal:local
saved backup bundle to $TESTTMP/b1/.hg/strip-backup/*-backup.hg (glob)
$ hg cat c2
c2
$
cd
..
$
hg
clone
-
q -u
.
b
b2
$
cd
b2
$
hg
rebase
-
s 2 -d 1 --tool internal:other
saved backup bundle to $TESTTMP/b2/.hg/strip-backup/*-backup.hg (glob)
$ hg cat c2
c2b
$
cd
..
$
hg
clone
-
q -u
.
b
b3
$
cd
b3
$
hg
rebase
-
s 2 -d 1 --tool internal:fail
abort: unresolved conflicts (see hg resolve, then hg rebase --continue)
[255]
$ hg resolve -l
U c2
$
hg
resolve
-
m c2
$ hg rebase -c
--
tool
internal:fail
tool
option
will
be
ignored
saved
backup
bundle
to
$TESTTMP
/b3/
.
hg
/strip-backup/
*-
backup
.
hg
(
glob
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment