changeset 3775:fa7b94606024 stable

tests: add a test demonstrating issue5897 When conflicts are caused due to `hg next --evolve`, `hg evolve --abort` breaks! This patch adds test to demonstrate that. This will be fixed in next patch.
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 30 May 2018 00:34:35 +0530
parents 115caa4e5278
children 2d450974bb1c
files tests/test-evolve-abort.t
diffstat 1 files changed, 57 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-evolve-abort.t	Thu May 24 01:50:26 2018 +0530
+++ b/tests/test-evolve-abort.t	Wed May 30 00:34:35 2018 +0530
@@ -496,3 +496,60 @@
   |/    () draft
   o  0:8fa14d15e168 added hgignore
       () draft
+
+Testing `--abort` when conflicts are caused due to `hg next --evolve`
+=====================================================================
+
+  $ hg next --evolve
+  move:[2] added b
+  atop:[4] added a
+  working directory now at c1f4718020e3
+  $ hg next --evolve
+  move:[3] added c
+  atop:[5] added b
+  merging c
+  warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
+  evolve failed!
+  fix conflict and run 'hg evolve --continue' or use 'hg evolve --abort' to abort
+  abort: unresolved merge conflicts (see hg help resolve)
+  [255]
+
+  $ hg evolve --abort
+  ** unknown exception encountered, please report by visiting
+  ** https://mercurial-scm.org/wiki/BugTracker
+  ** Python 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
+  ** Mercurial Distributed SCM (version 4.6+314-8e5a61602459+20180530)
+  ** Extensions loaded: evolve
+  Traceback (most recent call last):
+    File "/tmp/hgtests.B9AQfb/install/bin/hg", line 41, in <module>
+      dispatch.run()
+    File "/tmp/hgtests.B9AQfb/install/lib/python/mercurial/dispatch.py", line 90, in run
+      status = dispatch(req)
+    File "/tmp/hgtests.B9AQfb/install/lib/python/mercurial/dispatch.py", line 213, in dispatch
+      ret = _runcatch(req) or 0
+    File "/tmp/hgtests.B9AQfb/install/lib/python/mercurial/dispatch.py", line 354, in _runcatch
+      return _callcatch(ui, _runcatchfunc)
+    File "/tmp/hgtests.B9AQfb/install/lib/python/mercurial/dispatch.py", line 362, in _callcatch
+      return scmutil.callcatch(ui, func)
+    File "/tmp/hgtests.B9AQfb/install/lib/python/mercurial/scmutil.py", line 161, in callcatch
+      return func()
+    File "/tmp/hgtests.B9AQfb/install/lib/python/mercurial/dispatch.py", line 344, in _runcatchfunc
+      return _dispatch(req)
+    File "/tmp/hgtests.B9AQfb/install/lib/python/mercurial/dispatch.py", line 974, in _dispatch
+      cmdpats, cmdoptions)
+    File "/tmp/hgtests.B9AQfb/install/lib/python/mercurial/dispatch.py", line 730, in runcommand
+      ret = _runcommand(ui, options, cmd, d)
+    File "/tmp/hgtests.B9AQfb/install/lib/python/mercurial/dispatch.py", line 982, in _runcommand
+      return cmdfunc()
+    File "/tmp/hgtests.B9AQfb/install/lib/python/mercurial/dispatch.py", line 971, in <lambda>
+      d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
+    File "/tmp/hgtests.B9AQfb/install/lib/python/mercurial/util.py", line 1550, in check
+      return func(*args, **kwargs)
+    File "/home/foobar/repo/mutable-history/hgext3rd/evolve/evolvecmd.py", line 1234, in evolve
+      return abortevolve(ui, repo, evolvestate)
+    File "/home/foobar/repo/mutable-history/hgext3rd/evolve/evolvecmd.py", line 1289, in abortevolve
+      startnode = evolvestate['startnode']
+    File "/home/foobar/repo/mutable-history/hgext3rd/evolve/state.py", line 49, in __getitem__
+      return self.opts[key]
+  KeyError: 'startnode'
+  [1]