# HG changeset patch # User "Yann E. MORIN" # Date 2011-09-18 20:54:11 # Node ID 81adf7777f8f54b934e39b53c657fa1c09739ca0 # Parent b1c62c754bf8e23b2113cd5f562d58570bc92191 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" diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -235,8 +235,8 @@ def author(repo, subset, x): 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 @@ def bisected(repo, subset, x): 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 @@ symbols = { "ancestor": ancestor, "ancestors": ancestors, "author": author, + "bisect": bisect, "bisected": bisected, "bookmark": bookmark, "branch": branch, diff --git a/tests/test-bisect.t b/tests/test-bisect.t --- a/tests/test-bisect.t +++ b/tests/test-bisect.t @@ -377,7 +377,7 @@ reproduce AssertionError, issue1445 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 @@ reproduce AssertionError, issue1445 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 @@ reproduce AssertionError, issue1445 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