diff mercurial/commands.py @ 5776:35ec669cdd43

bisect: handle search for bad to good transitions Automatically detect whether we're looking for a bad to good transition rather than the usual good to bad transition by detecting when badrev is inside the good set and flipping good/bad.
author Matt Mackall <mpm@selenic.com>
date Mon, 31 Dec 2007 18:20:34 -0600
parents 2dd202a6e15b
children 9e97a7a0bb82
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Dec 31 18:20:34 2007 -0600
+++ b/mercurial/commands.py	Mon Dec 31 18:20:34 2007 -0600
@@ -258,11 +258,6 @@
     working directory as bad or good and bisect will either update to
     another candidate changeset or announce that it has found the bad
     revision.
-
-    Note: bisect expects bad revisions to be descendants of good
-    revisions. If you are looking for the point at which a problem was
-    fixed, then make the problem-free state \"bad\" and the
-    problematic state \"good.\"
     """
     # backward compatibility
     if rev in "good bad reset init".split():
@@ -317,9 +312,9 @@
         return
 
     # actually bisect
-    node, changesets = hbisect.bisect(repo.changelog, state)
+    node, changesets, good = hbisect.bisect(repo.changelog, state)
     if changesets == 0:
-        ui.write(_("The first bad revision is:\n"))
+        ui.write(_("The first %s revision is:\n") % (good and "good" or "bad"))
         displayer = cmdutil.show_changeset(ui, repo, {})
         displayer.show(changenode=node)
     elif node is not None: