revset: rename bisected() to bisect()
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun, 18 Sep 2011 22:54:11 +0200
changeset 15134 81adf7777f8f
parent 15133 b1c62c754bf8
child 15135 f19de58af225
revset: rename bisected() to bisect() Rename the 'bisected' keyword to simply 'bisect'. Still accept the old name, but no longer advertise it. As discussed with Matt on IRC. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
mercurial/revset.py
tests/test-bisect.t
--- a/mercurial/revset.py	Sun Sep 18 10:07:51 2011 +0200
+++ b/mercurial/revset.py	Sun Sep 18 22:54:11 2011 +0200
@@ -235,8 +235,8 @@
     n = getstring(x, _("author requires a string")).lower()
     return [r for r in subset if n in repo[r].user().lower()]
 
-def bisected(repo, subset, x):
-    """``bisected(string)``
+def bisect(repo, subset, x):
+    """``bisect(string)``
     Changesets marked in the specified bisect state (good, bad, skip).
     """
     state = getstring(x, _("bisect requires a string")).lower()
@@ -245,6 +245,11 @@
     marked = set(repo.changelog.rev(n) for n in hbisect.load_state(repo)[state])
     return [r for r in subset if r in marked]
 
+# Backward-compatibility
+# - no help entry so that we do not advertise it any more
+def bisected(repo, subset, x):
+    return bisect(repo, subset, x)
+
 def bookmark(repo, subset, x):
     """``bookmark([name])``
     The named bookmark or all bookmarks.
@@ -837,6 +842,7 @@
     "ancestor": ancestor,
     "ancestors": ancestors,
     "author": author,
+    "bisect": bisect,
     "bisected": bisected,
     "bookmark": bookmark,
     "branch": branch,
--- a/tests/test-bisect.t	Sun Sep 18 10:07:51 2011 +0200
+++ b/tests/test-bisect.t	Sun Sep 18 22:54:11 2011 +0200
@@ -377,7 +377,7 @@
   date:        Thu Jan 01 00:00:06 1970 +0000
   summary:     msg 6
   
-  $ hg log -r "bisected(good)"
+  $ hg log -r "bisect(good)"
   changeset:   0:b99c7b9c8e11
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -388,13 +388,13 @@
   date:        Thu Jan 01 00:00:05 1970 +0000
   summary:     msg 5
   
-  $ hg log -r "bisected(bad)"
+  $ hg log -r "bisect(bad)"
   changeset:   6:a3d5c6fdf0d3
   user:        test
   date:        Thu Jan 01 00:00:06 1970 +0000
   summary:     msg 6
   
-  $ hg log -r "bisected(skip)"
+  $ hg log -r "bisect(skip)"
   changeset:   1:5cd978ea5149
   user:        test
   date:        Thu Jan 01 00:00:01 1970 +0000
@@ -416,6 +416,15 @@
   summary:     msg 4
   
 
+test legacy bisected() keyword
+
+  $ hg log -r "bisected(bad)"
+  changeset:   6:a3d5c6fdf0d3
+  user:        test
+  date:        Thu Jan 01 00:00:06 1970 +0000
+  summary:     msg 6
+  
+
   $ set +e
 
 test invalid command