changeset 32131:35a69efbf190

bisect: allow resetting with unfinished graft/rebase/etc "hg bisect --reset" just deletes the state file (it doesn't move back to the starting point like rebase does); it can not conflict with an ongoing rebase etc. checkunfinished() has this documentation: It's probably good to check this right before bailifchanged(). So that's where I moved it.
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 03 May 2017 09:09:44 -0700
parents c3dcec6cbc1b
children 6dea1701f170
files mercurial/commands.py tests/test-bisect.t
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Apr 21 01:13:18 2017 +0530
+++ b/mercurial/commands.py	Wed May 03 09:09:44 2017 -0700
@@ -837,8 +837,6 @@
     elif extra or good + bad + skip + reset + extend + bool(command) > 1:
         raise error.Abort(_('incompatible arguments'))
 
-    cmdutil.checkunfinished(repo)
-
     if reset:
         hbisect.resetstate(repo)
         return
@@ -865,6 +863,7 @@
         """common used update sequence"""
         if noupdate:
             return
+        cmdutil.checkunfinished(repo)
         cmdutil.bailifchanged(repo)
         return hg.clean(repo, node, show_stats=show_stats)
 
--- a/tests/test-bisect.t	Fri Apr 21 01:13:18 2017 +0530
+++ b/tests/test-bisect.t	Wed May 03 09:09:44 2017 -0700
@@ -551,7 +551,14 @@
   date:        Thu Jan 01 00:00:06 1970 +0000
   summary:     msg 6
   
-
+  $ hg graft -q 15
+  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
+  abort: unresolved conflicts, can't continue
+  (use 'hg resolve' and 'hg graft --continue')
+  [255]
+  $ hg bisect --reset
+  $ hg up -C .
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Check that bisect does not break on obsolete changesets
 =========================================================