hgext/mq.py
changeset 3492 fbf8320f25c8
parent 3473 0e68608bd11d
child 3526 68341c06bc61
child 3547 891c8d20f80f
equal deleted inserted replaced
3491:23cffef5d424 3492:fbf8320f25c8
  2000                     self.ui.warn('Tag %s overrides mq patch of the same name\n' % patch[1])
  2000                     self.ui.warn('Tag %s overrides mq patch of the same name\n' % patch[1])
  2001                 else:
  2001                 else:
  2002                     tagscache[patch[1]] = revlog.bin(patch[0])
  2002                     tagscache[patch[1]] = revlog.bin(patch[0])
  2003 
  2003 
  2004             return tagscache
  2004             return tagscache
       
  2005 
       
  2006         def branchtags(self):
       
  2007             if self.branchcache != None:
       
  2008                 return self.branchcache
       
  2009 
       
  2010             q = self.mq
       
  2011             if not q.applied:
       
  2012                 return super(mqrepo, self).branchtags()
       
  2013 
       
  2014             self.branchcache = {} # avoid recursion in changectx
       
  2015             cl = self.changelog
       
  2016             partial, last, lrev = self._readbranchcache()
       
  2017 
       
  2018             qbase = cl.rev(revlog.bin(q.applied[0].rev))
       
  2019             start = lrev + 1
       
  2020             if start < qbase:
       
  2021                 # update the cache (excluding the patches) and save it
       
  2022                 self._updatebranchcache(partial, lrev+1, qbase)
       
  2023                 self._writebranchcache(partial, cl.node(qbase-1), qbase-1)
       
  2024                 start = qbase
       
  2025             # if start = qbase, the cache is as updated as it should be.
       
  2026             # if start > qbase, the cache includes (part of) the patches.
       
  2027             # we might as well use it, but we won't save it.
       
  2028 
       
  2029             # update the cache up to the tip
       
  2030             self._updatebranchcache(partial, start, cl.count())
       
  2031 
       
  2032             self.branchcache = partial
       
  2033             return self.branchcache
  2005 
  2034 
  2006     if repo.local():
  2035     if repo.local():
  2007         repo.__class__ = mqrepo
  2036         repo.__class__ = mqrepo
  2008         repo.mq = queue(ui, repo.join(""))
  2037         repo.mq = queue(ui, repo.join(""))
  2009 
  2038