mercurial/revset.py
changeset 13750 7eb82f88e157
parent 13670 15b97a1cd60b
child 13873 02c3d4d44a92
equal deleted inserted replaced
13749:8bb03283e9b9 13750:7eb82f88e157
   296             if p in s:
   296             if p in s:
   297                 cs.add(r)
   297                 cs.add(r)
   298     return [r for r in subset if r in cs]
   298     return [r for r in subset if r in cs]
   299 
   299 
   300 def branch(repo, subset, x):
   300 def branch(repo, subset, x):
   301     """``branch(set)``
   301     """``branch(string or set)``
   302     All changesets belonging to the branches of changesets in set.
   302     All changesets belonging to the given branch or the branches of the given
   303     """
   303     changesets.
       
   304     """
       
   305     try:
       
   306         b = getstring(x, '')
       
   307         if b in repo.branchmap():
       
   308             return [r for r in subset if repo[r].branch() == b]
       
   309     except error.ParseError:
       
   310         # not a string, but another revspec, e.g. tip()
       
   311         pass
       
   312 
   304     s = getset(repo, range(len(repo)), x)
   313     s = getset(repo, range(len(repo)), x)
   305     b = set()
   314     b = set()
   306     for r in s:
   315     for r in s:
   307         b.add(repo[r].branch())
   316         b.add(repo[r].branch())
   308     s = set(s)
   317     s = set(s)