# HG changeset patch # User Pulkit Goyal <7895pul...@gmail.com> # Date 1479915042 -19800 # Wed Nov 23 21:00:42 2016 +0530 # Node ID 32083f1f0c67341e5b4c22e880b70ccc4e0fc088 # Parent cb2bac3253fbd52894ffcb4719a148fe6a3da38b evolve: improve error message if unstable changes are disallowed
I saw a question on stackoverflow why evolve reports something like cannot fold chain not ending with head. Even I was confused the first time about the behavior. The error message can be improved to avoid confusion to people who are unaware about the config in future. diff -r cb2bac3253fb -r 32083f1f0c67 hgext/evolve.py --- a/hgext/evolve.py Wed Nov 02 18:56:44 2016 +0100 +++ b/hgext/evolve.py Wed Nov 23 21:00:42 2016 +0530 @@ -2514,7 +2514,8 @@ raise error.Abort('nothing to prune') if _disallowednewunstable(repo, revs): - raise error.Abort(_("cannot prune in the middle of a stack")) + raise error.Abort(_("cannot prune in the middle of a stack\n"\ + "new unstable changesets are not allowed")) # defines successors changesets sucs = scmutil.revrange(repo, succs) @@ -3234,7 +3235,8 @@ newunstable = _disallowednewunstable(repo, revs) if newunstable: raise error.Abort( - _('cannot edit commit information in the middle of a stack'), + _('cannot edit commit information in the middle of a stack\n'\ + 'new unstable changesets are not allowed'), hint=_('%s will be affected') % repo[newunstable.first()]) root = head = repo[revs.first()] @@ -3299,7 +3301,8 @@ head = repo[heads.first()] if _disallowednewunstable(repo, revs): raise error.Abort(_("cannot fold chain not ending with a head "\ - "or with branching")) + "or with branching\nnew unstable changesets are"\ + " not allowed")) return root, head def _disallowednewunstable(repo, revs): diff -r cb2bac3253fb -r 32083f1f0c67 tests/test-evolve.t --- a/tests/test-evolve.t Wed Nov 02 18:56:44 2016 +0100 +++ b/tests/test-evolve.t Wed Nov 23 21:00:42 2016 +0530 @@ -1301,9 +1301,11 @@ created new head $ hg prune '26 + 27' abort: cannot prune in the middle of a stack + new unstable changesets are not allowed [255] $ hg prune '19::28' abort: cannot prune in the middle of a stack + new unstable changesets are not allowed [255] $ hg prune '26::' 3 changesets pruned @@ -1338,9 +1340,11 @@ $ hg fold --exact "19 + 18" abort: cannot fold chain not ending with a head or with branching + new unstable changesets are not allowed [255] $ hg fold --exact "18::29" abort: cannot fold chain not ending with a head or with branching + new unstable changesets are not allowed [255] $ hg fold --exact "19::" 2 changesets folded @@ -1483,10 +1487,12 @@ check that metaedit respects allowunstable $ hg metaedit '.^' --config 'experimental.evolution=createmarkers, allnewcommands' abort: cannot edit commit information in the middle of a stack + new unstable changesets are not allowed (c904da5245b0 will be affected) [255] $ hg metaedit '18::20' --fold --config 'experimental.evolution=createmarkers, allnewcommands' abort: cannot fold chain not ending with a head or with branching + new unstable changesets are not allowed [255] $ hg metaedit --user foobar 0 files updated, 0 files merged, 0 files removed, 0 files unresolved _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel