##// END OF EJS Templates
localrepo and dirstate: rename reload to invalidate...
Matt Mackall -
r4613:3a645af7 default
parent child Browse files
Show More
@@ -453,8 +453,8 b' class queue:'
453 453 try:
454 454 tr.abort()
455 455 finally:
456 repo.reload()
457 repo.wreload()
456 repo.invalidate()
457 repo.dirstate.invalidate()
458 458 raise
459 459
460 460 def _apply(self, tr, repo, series, list=False, update_status=True,
@@ -149,7 +149,7 b' class dirstate(object):'
149 149 dmap[f] = e[:4]
150 150 pos = newpos
151 151
152 def reload(self):
152 def invalidate(self):
153 153 for a in "map copymap _branch pl dirs _ignore".split():
154 154 if hasattr(self, a):
155 155 self.__delattr__(a)
@@ -228,7 +228,7 b' class dirstate(object):'
228 228 pass
229 229
230 230 def rebuild(self, parent, files):
231 self.reload()
231 self.invalidate()
232 232 for f in files:
233 233 if files.execf(f):
234 234 self.map[f] = ('n', 0777, -1, 0)
@@ -586,7 +586,7 b' class localrepository(repo.repository):'
586 586 if os.path.exists(self.sjoin("journal")):
587 587 self.ui.status(_("rolling back interrupted transaction\n"))
588 588 transaction.rollback(self.sopener, self.sjoin("journal"))
589 self.reload()
589 self.invalidate()
590 590 return True
591 591 else:
592 592 self.ui.warn(_("no interrupted transaction available\n"))
@@ -601,17 +601,15 b' class localrepository(repo.repository):'
601 601 self.ui.status(_("rolling back last transaction\n"))
602 602 transaction.rollback(self.sopener, self.sjoin("undo"))
603 603 util.rename(self.join("undo.dirstate"), self.join("dirstate"))
604 self.reload()
605 self.wreload()
604 self.invalidate()
605 self.dirstate.invalidate()
606 606 else:
607 607 self.ui.warn(_("no rollback information available\n"))
608 608
609 def wreload(self):
610 self.dirstate.reload()
611
612 def reload(self):
613 self.changelog.load()
614 self.manifest.load()
609 def invalidate(self):
610 for a in "changelog manifest".split():
611 if hasattr(self, a):
612 self.__delattr__(a)
615 613 self.tagscache = None
616 614 self.nodetagscache = None
617 615
@@ -632,12 +630,13 b' class localrepository(repo.repository):'
632 630 return l
633 631
634 632 def lock(self, wait=1):
635 return self.do_lock(self.sjoin("lock"), wait, acquirefn=self.reload,
633 return self.do_lock(self.sjoin("lock"), wait,
634 acquirefn=self.invalidate,
636 635 desc=_('repository %s') % self.origroot)
637 636
638 637 def wlock(self, wait=1):
639 638 return self.do_lock(self.join("wlock"), wait, self.dirstate.write,
640 self.wreload,
639 self.dirstate.invalidate,
641 640 desc=_('working directory of %s') % self.origroot)
642 641
643 642 def filecommit(self, fn, manifest1, manifest2, linkrev, transaction, changelist):
@@ -1932,7 +1931,7 b' class localrepository(repo.repository):'
1932 1931 self.ui.status(_('transferred %s in %.1f seconds (%s/sec)\n') %
1933 1932 (util.bytecount(total_bytes), elapsed,
1934 1933 util.bytecount(total_bytes / elapsed)))
1935 self.reload()
1934 self.invalidate()
1936 1935 return len(self.heads()) + 1
1937 1936
1938 1937 def clone(self, remote, heads=[], stream=False):
General Comments 0
You need to be logged in to leave comments. Login now