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