mercurial/localrepo.py
changeset 10392 9be6c5900c07
parent 10371 eacfff116e17
child 10396 65a90c8e11ee
equal deleted inserted replaced
10391:935ef1836b2f 10392:9be6c5900c07
   348     def branchtags(self):
   348     def branchtags(self):
   349         '''return a dict where branch names map to the tipmost head of
   349         '''return a dict where branch names map to the tipmost head of
   350         the branch, open heads come before closed'''
   350         the branch, open heads come before closed'''
   351         bt = {}
   351         bt = {}
   352         for bn, heads in self.branchmap().iteritems():
   352         for bn, heads in self.branchmap().iteritems():
   353             head = None
   353             tip = heads[-1]
   354             for i in range(len(heads)-1, -1, -1):
   354             for h in reversed(heads):
   355                 h = heads[i]
       
   356                 if 'close' not in self.changelog.read(h)[5]:
   355                 if 'close' not in self.changelog.read(h)[5]:
   357                     head = h
   356                     tip = h
   358                     break
   357                     break
   359             # no open heads were found
   358             bt[bn] = tip
   360             if head is None:
       
   361                 head = heads[-1]
       
   362             bt[bn] = head
       
   363         return bt
   359         return bt
   364 
   360 
   365 
   361 
   366     def _readbranchcache(self):
   362     def _readbranchcache(self):
   367         partial = {}
   363         partial = {}