[issue2327] hg bisect should have -f option

Russ Cox bugs at mercurial.selenic.com
Thu Aug 12 23:33:14 UTC 2010


New submission from Russ Cox <rsc at swtch.com>:

Almost every time I want to bisect, it's because I've found
that changing something in the tree exposes the bug.  
Now, it's possible to run bisect, make the change that
exposes the bug, test, revert the change, run bisect, etc.,
but usually update's merger can take care of that for me.
Except that bisect doesn't have a -f flag.  This patch adds 
it with the obvious meaning.


diff -u commands0.py commands.py
--- commands0.py	2010-08-12 16:27:58.000000000 -0700
+++ commands.py	2010-08-12 16:30:11.000000000 -0700
@@ -312,7 +312,7 @@
                         'if you want to auto-merge)\n'))
 
 def bisect(ui, repo, rev=None, extra=None, command=None,
-               reset=None, good=None, bad=None, skip=None, noupdate=None):
+               reset=None, good=None, bad=None, skip=None, noupdate=None, 
force=None):
     """subdivision search of changesets
 
     This command helps to find changesets which introduce problems. To
@@ -411,7 +411,8 @@
                 # bisect
                 nodes, changesets, good = hbisect.bisect(repo.changelog, 
state)
                 # update to next check
-                cmdutil.bail_if_changed(repo)
+                if not force:
+                    cmdutil.bail_if_changed(repo)
                 hg.clean(repo, nodes[0], show_stats=False)
         finally:
             hbisect.save_state(repo, state)
@@ -448,7 +449,8 @@
                    "(%d changesets remaining, ~%d tests)\n")
                  % (rev, short(node), changesets, tests))
         if not noupdate:
-            cmdutil.bail_if_changed(repo)
+            if not force:
+                cmdutil.bail_if_changed(repo)
             return hg.clean(repo, node)
 
 def branch(ui, repo, label=None, **opts):
@@ -4001,7 +4003,8 @@
           ('s', 'skip', False, _('skip testing changeset')),
           ('c', 'command', '',
            _('use command to check changeset state'), _('CMD')),
-          ('U', 'noupdate', False, _('do not update to target'))],
+          ('U', 'noupdate', False, _('do not update to target')),
+          ('f', 'force', False, _('skip check for outstanding uncommitted 
changes'))],
          _("[-gbsr] [-U] [-c CMD] [REV]")),
     "branch":
         (branch,

----------
messages: 13326
nosy: rsc
priority: feature
status: unread
title: hg bisect should have -f option

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2327>
____________________________________________________


More information about the Mercurial-devel mailing list