diff -r 8bb03283e9b9 -r 7eb82f88e157 mercurial/revset.py --- a/mercurial/revset.py Wed Mar 23 22:58:40 2011 +0100 +++ b/mercurial/revset.py Wed Mar 23 19:28:16 2011 -0500 @@ -298,9 +298,18 @@ return [r for r in subset if r in cs] def branch(repo, subset, x): - """``branch(set)`` - All changesets belonging to the branches of changesets in set. + """``branch(string or set)`` + All changesets belonging to the given branch or the branches of the given + changesets. """ + try: + b = getstring(x, '') + if b in repo.branchmap(): + return [r for r in subset if repo[r].branch() == b] + except error.ParseError: + # not a string, but another revspec, e.g. tip() + pass + s = getset(repo, range(len(repo)), x) b = set() for r in s: