##// END OF EJS Templates
merge with crew
Thomas Arendsen Hein -
r6126:11a09d57 merge default
parent child Browse files
Show More
@@ -2186,20 +2186,17 b' def reposetup(ui, repo):'
2186
2186
2187 return tagscache
2187 return tagscache
2188
2188
2189 def _branchtags(self):
2189 def _branchtags(self, partial, lrev):
2190 q = self.mq
2190 q = self.mq
2191 if not q.applied:
2191 if not q.applied:
2192 return super(mqrepo, self)._branchtags()
2192 return super(mqrepo, self)._branchtags(partial, lrev)
2193
2193
2194 cl = self.changelog
2194 cl = self.changelog
2195 qbasenode = revlog.bin(q.applied[0].rev)
2195 qbasenode = revlog.bin(q.applied[0].rev)
2196 if qbasenode not in cl.nodemap:
2196 if qbasenode not in cl.nodemap:
2197 self.ui.warn('mq status file refers to unknown node %s\n'
2197 self.ui.warn('mq status file refers to unknown node %s\n'
2198 % revlog.short(qbasenode))
2198 % revlog.short(qbasenode))
2199 return super(mqrepo, self)._branchtags()
2199 return super(mqrepo, self)._branchtags(partial, lrev)
2200
2201 self.branchcache = {} # avoid recursion in changectx
2202 partial, last, lrev = self._readbranchcache()
2203
2200
2204 qbase = cl.rev(qbasenode)
2201 qbase = cl.rev(qbasenode)
2205 start = lrev + 1
2202 start = lrev + 1
@@ -94,6 +94,8 b' class localrepository(repo.repository):'
94 self.tagscache = None
94 self.tagscache = None
95 self._tagstypecache = None
95 self._tagstypecache = None
96 self.branchcache = None
96 self.branchcache = None
97 self._ubranchcache = None # UTF-8 version of branchcache
98 self._branchcachetip = None
97 self.nodetagscache = None
99 self.nodetagscache = None
98 self.filterpats = {}
100 self.filterpats = {}
99 self._datafilters = {}
101 self._datafilters = {}
@@ -344,9 +346,7 b' class localrepository(repo.repository):'
344 self.nodetagscache.setdefault(n, []).append(t)
346 self.nodetagscache.setdefault(n, []).append(t)
345 return self.nodetagscache.get(node, [])
347 return self.nodetagscache.get(node, [])
346
348
347 def _branchtags(self):
349 def _branchtags(self, partial, lrev):
348 partial, last, lrev = self._readbranchcache()
349
350 tiprev = self.changelog.count() - 1
350 tiprev = self.changelog.count() - 1
351 if lrev != tiprev:
351 if lrev != tiprev:
352 self._updatebranchcache(partial, lrev+1, tiprev+1)
352 self._updatebranchcache(partial, lrev+1, tiprev+1)
@@ -355,16 +355,29 b' class localrepository(repo.repository):'
355 return partial
355 return partial
356
356
357 def branchtags(self):
357 def branchtags(self):
358 if self.branchcache is not None:
358 tip = self.changelog.tip()
359 if self.branchcache is not None and self._branchcachetip == tip:
359 return self.branchcache
360 return self.branchcache
360
361
361 self.branchcache = {} # avoid recursion in changectx
362 oldtip = self._branchcachetip
362 partial = self._branchtags()
363 self._branchcachetip = tip
364 if self.branchcache is None:
365 self.branchcache = {} # avoid recursion in changectx
366 else:
367 self.branchcache.clear() # keep using the same dict
368 if oldtip is None or oldtip not in self.changelog.nodemap:
369 partial, last, lrev = self._readbranchcache()
370 else:
371 lrev = self.changelog.rev(oldtip)
372 partial = self._ubranchcache
373
374 self._branchtags(partial, lrev)
363
375
364 # the branch cache is stored on disk as UTF-8, but in the local
376 # the branch cache is stored on disk as UTF-8, but in the local
365 # charset internally
377 # charset internally
366 for k, v in partial.items():
378 for k, v in partial.items():
367 self.branchcache[util.tolocal(k)] = v
379 self.branchcache[util.tolocal(k)] = v
380 self._ubranchcache = partial
368 return self.branchcache
381 return self.branchcache
369
382
370 def _readbranchcache(self):
383 def _readbranchcache(self):
@@ -616,6 +629,9 b' class localrepository(repo.repository):'
616 self.tagscache = None
629 self.tagscache = None
617 self._tagstypecache = None
630 self._tagstypecache = None
618 self.nodetagscache = None
631 self.nodetagscache = None
632 self.branchcache = None
633 self._ubranchcache = None
634 self._branchcachetip = None
619
635
620 def _lock(self, lockname, wait, releasefn, acquirefn, desc):
636 def _lock(self, lockname, wait, releasefn, acquirefn, desc):
621 try:
637 try:
@@ -882,8 +898,8 b' class localrepository(repo.repository):'
882 parent2=xp2)
898 parent2=xp2)
883 tr.close()
899 tr.close()
884
900
885 if self.branchcache and "branch" in extra:
901 if self.branchcache:
886 self.branchcache[util.tolocal(extra["branch"])] = n
902 self.branchtags()
887
903
888 if use_dirstate or update_dirstate:
904 if use_dirstate or update_dirstate:
889 self.dirstate.setparents(n)
905 self.dirstate.setparents(n)
@@ -2005,7 +2021,6 b' class localrepository(repo.repository):'
2005 if changesets > 0:
2021 if changesets > 0:
2006 # forcefully update the on-disk branch cache
2022 # forcefully update the on-disk branch cache
2007 self.ui.debug(_("updating the branch cache\n"))
2023 self.ui.debug(_("updating the branch cache\n"))
2008 self.branchcache = None
2009 self.branchtags()
2024 self.branchtags()
2010 self.hook("changegroup", node=hex(self.changelog.node(cor+1)),
2025 self.hook("changegroup", node=hex(self.changelog.node(cor+1)),
2011 source=srctype, url=url)
2026 source=srctype, url=url)
General Comments 0
You need to be logged in to leave comments. Login now