[PATCH 1 of 2] Add a new --log (or -l) option to bisect

Bernhard Leiner mailinglists.bleiner at gmail.com
Tue Nov 11 16:19:28 CST 2008


# HG changeset patch
# User Bernhard Leiner <bleiner at gmail.com>
# Date 1226440776 -3600
# Node ID d872a5a414854dc611ef794dd89b0514c6c92301
# Parent  f711b8e0d2b335398074422037617ed10c258da3
Add a new --log (or -l) option to bisect

This is a more convinient way to show the current bisect state information
than 'cat .hg/bisect.state'

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -260,8 +260,8 @@
             ui.status(_('(use "backout --merge" '
                         '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):
+def bisect(ui, repo, rev=None, extra=None, command=None, reset=None,
+           good=None, bad=None, skip=None, noupdate=None, log=None):
     """subdivision search of changesets
 
     This command helps to find changesets which introduce problems.
@@ -325,6 +325,12 @@
             os.unlink(p)
         return
 
+    if log:
+        if os.path.exists(repo.join("bisect.state")):
+            for l in repo.opener("bisect.state"):
+                ui.write(_("%s" % l))
+        return
+
     state = hbisect.load_state(repo)
 
     if command:
@@ -3041,9 +3047,10 @@
           ('g', 'good', False, _('mark changeset good')),
           ('b', 'bad', False, _('mark changeset bad')),
           ('s', 'skip', False, _('skip testing changeset')),
+          ('l', 'log', False, _('print bisect state')),
           ('c', 'command', '', _('Use command to check changeset state')),
           ('U', 'noupdate', False, _('do not update to target'))],
-         _("hg bisect [-gbsr] [-c CMD] [REV]")),
+         _("hg bisect [-gbsrl] [-c CMD] [REV]")),
     "branch":
         (branch,
          [('f', 'force', None,


More information about the Mercurial-devel mailing list