Commit 46d577f9 authored by Laurent Charignon's avatar Laurent Charignon
Browse files

evolve: handle split commit for instability

parent bc4c7b1bb793
......@@ -1708,10 +1708,17 @@ def _solveunstable(ui, repo, orig, dryrun=False, confirm=False,
targets = newer[0]
assert targets
if len(targets) > 1:
msg = _("does not handle split parents yet\n")
ui.write_err(msg)
return 2
target = targets[0]
# split target, figure out which one to pick, are they all in line?
targetrevs = [repo[r].rev() for r in targets]
roots = repo.revs('roots(%ld)', targetrevs)
heads = repo.revs('heads(%ld)', targetrevs)
if len(roots) > 1 or len(heads) > 1:
msg = "cannot solve split accross two branches\n"
ui.write_err(msg)
return 2
target = repo[heads.first()]
else:
target = targets[0]
displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate})
target = repo[target]
if not ui.quiet or confirm:
......
......@@ -58,4 +58,6 @@ Create a split commit
o 0:58663bb03074@default(draft) add aa
$ hg evolve --rev "0::"
does not handle split parents yet
move:[2] add uu
atop:[4] _pp
working directory is now at 6f5bbe2e3df3
......@@ -1393,6 +1393,8 @@ Create a split commit
o 18:0bb66d4c1968@default(draft) a3
|
$ hg evolve --rev "18::"
does not handle split parents yet
move:[33] add uu
atop:[35] _pp
working directory is now at 04fae07745d4
......@@ -182,7 +182,6 @@ Not supported yet
===============================================================================
Test instability resolution for a changeset unstable because its parent
is obsolete with multiple successors all in one chain (simple split)
Not supported yet
==============================================================================
$ hg init test4
......@@ -208,16 +207,16 @@ Not supported yet
$ hg evo --all --any --unstable
does not handle split parents yet
move:[2] add _c
atop:[4] add bprimesplit2
working directory is now at 387cc1e837d7
$ hg log -G
@ 4:2a4ccc0bb20c@default(draft) add bprimesplit2
@ 5:387cc1e837d7@default(draft) add _c
|
o 4:2a4ccc0bb20c@default(draft) add bprimesplit2
|
o 3:8b87864bd0f4@default(draft) add bprimesplit1
|
| o 2:102002290587@default(draft) add _c
| |
| x 1:37445b16603b@default(draft) add _b
|/
o 0:135f39f4bd78@default(draft) add _a
......@@ -228,7 +227,6 @@ Not supported yet
Test instability resolution for a changeset unstable because its parent
is obsolete with multiple successors on one branches but in reverse
order (cross-split).
Not supported yet
==============================================================================
$ hg init test5
......@@ -263,16 +261,16 @@ Not supported yet
$ hg evo --all --any --unstable
does not handle split parents yet
move:[2] add _c
atop:[6] add bsecondsplit2
working directory is now at 98e3f21461ff
$ hg log -G
@ 6:59b942dbda14@default(draft) add bsecondsplit2
@ 7:98e3f21461ff@default(draft) add _c
|
o 6:59b942dbda14@default(draft) add bsecondsplit2
|
o 5:8ffdae67d696@default(draft) add bsecondsplit1
|
| o 2:102002290587@default(draft) add _c
| |
| x 1:37445b16603b@default(draft) add _b
|/
o 0:135f39f4bd78@default(draft) add _a
......@@ -312,7 +310,7 @@ Not supported yet
$ hg evo --all --any --unstable
does not handle split parents yet
cannot solve split accross two branches
$ hg log -G
@ 4:3c69ea6aa93e@default(draft) add bprimesplit2
|
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment