# HG changeset patch # User Laurent Charignon # Date 1433186952 25200 # Node ID b4a62d6f03534de6e65962c0e92cadea4b6cbad1 # Parent 935508184d4726f4234315624ef502667844a3d6 evolve: don't crash on singled out revisions Before this patch, we were crashing on unsolvable revisions when using evolve --rev. This patch removes the crash and prints a warning when we encounter such revision. diff -r 935508184d47 -r b4a62d6f0353 hgext/evolve.py --- a/hgext/evolve.py Mon Jun 01 10:58:50 2015 -0700 +++ b/hgext/evolve.py Mon Jun 01 12:29:12 2015 -0700 @@ -1398,9 +1398,12 @@ progresscb=None): """Stabilize a unstable changeset""" obs = orig.parents()[0] - if not obs.obsolete(): + if not obs.obsolete() and len(orig.parents()) == 2: obs = orig.parents()[1] # second parent is obsolete ? - assert obs.obsolete() + + if not obs.obsolete(): + ui.warn("cannot solve instability of %s, skipping\n" % orig) + return False newer = obsolete.successorssets(repo, obs.node()) # search of a parent which is not killed while not newer or newer == [()]: diff -r 935508184d47 -r b4a62d6f0353 tests/test-evolve.t --- a/tests/test-evolve.t Mon Jun 01 10:58:50 2015 -0700 +++ b/tests/test-evolve.t Mon Jun 01 12:29:12 2015 -0700 @@ -1027,5 +1027,44 @@ | o 0 : a0 - test +Check hg evolve --rev on singled out commit + $ hg up 19 -C + 1 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ mkcommit j1 + $ mkcommit j2 + $ mkcommit j3 + $ hg up .^^ + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + $ echo "hello" > j4 + $ hg add j4 + $ hg amend + 2 new unstable changesets + $ hg log -G + @ 25 : add j1 - test + | + | o 23 : add j3 - test + | | + | o 22 : add j2 - test + | | + | x 21 : add j1 - test + |/ + | o 20 : add gh - test + | | + o | 19 : add gg - test + |/ + o 18 : a3 - test + | + o 13 : bumped update to f37ed7a60f43: - test + | + o 11 : a2 - test + | + o 10 testbookmark: a1__ - test + | + o 0 : a0 - test + + + $ hg evolve --rev 23 + cannot solve instability of c70048fd3350, skipping +