mercurial/branchmap.py
changeset 20245 4edd179fefb8
parent 20190 d5d25e541637
child 20260 586ec8fe1c3c
equal deleted inserted replaced
20244:47d0843647d1 20245:4edd179fefb8
   165                     and (self.filteredhash == self._hashfiltered(repo)))
   165                     and (self.filteredhash == self._hashfiltered(repo)))
   166         except IndexError:
   166         except IndexError:
   167             return False
   167             return False
   168 
   168 
   169     def _branchtip(self, heads):
   169     def _branchtip(self, heads):
       
   170         '''Return tuple with last open head in heads and false,
       
   171         otherwise return last closed head and true.'''
   170         tip = heads[-1]
   172         tip = heads[-1]
   171         closed = True
   173         closed = True
   172         for h in reversed(heads):
   174         for h in reversed(heads):
   173             if h not in self._closednodes:
   175             if h not in self._closednodes:
   174                 tip = h
   176                 tip = h
   175                 closed = False
   177                 closed = False
   176                 break
   178                 break
   177         return tip, closed
   179         return tip, closed
   178 
   180 
   179     def branchtip(self, branch):
   181     def branchtip(self, branch):
       
   182         '''Return the tipmost open head on branch head, otherwise return the
       
   183         tipmost closed head on branch.
       
   184         Raise KeyError for unknown branch.'''
   180         return self._branchtip(self[branch])[0]
   185         return self._branchtip(self[branch])[0]
   181 
   186 
   182     def branchheads(self, branch, closed=False):
   187     def branchheads(self, branch, closed=False):
   183         heads = self[branch]
   188         heads = self[branch]
   184         if not closed:
   189         if not closed: