Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 10547:bae9bb09166b stable
strip: invalidate all caches after stripping (fixes issue1951)
test thanks to Stefano Tortarolo
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Sun, 21 Feb 2010 20:59:27 +0100 |
parents | b07d487009b2 |
children | 5f091fc1bab7 e930017f9e2a |
comparison
equal
deleted
inserted
replaced
10546:3a69afd6987e | 10547:bae9bb09166b |
---|---|
620 else: | 620 else: |
621 self.ui.warn(_("no rollback information available\n")) | 621 self.ui.warn(_("no rollback information available\n")) |
622 finally: | 622 finally: |
623 release(lock, wlock) | 623 release(lock, wlock) |
624 | 624 |
625 def invalidate(self): | 625 def invalidatecaches(self): |
626 for a in "changelog manifest".split(): | |
627 if a in self.__dict__: | |
628 delattr(self, a) | |
629 self._tags = None | 626 self._tags = None |
630 self._tagtypes = None | 627 self._tagtypes = None |
631 self.nodetagscache = None | 628 self.nodetagscache = None |
632 self._branchcache = None # in UTF-8 | 629 self._branchcache = None # in UTF-8 |
633 self._branchcachetip = None | 630 self._branchcachetip = None |
631 | |
632 def invalidate(self): | |
633 for a in "changelog manifest".split(): | |
634 if a in self.__dict__: | |
635 delattr(self, a) | |
636 self.invalidatecaches() | |
634 | 637 |
635 def _lock(self, lockname, wait, releasefn, acquirefn, desc): | 638 def _lock(self, lockname, wait, releasefn, acquirefn, desc): |
636 try: | 639 try: |
637 l = lock.lock(lockname, 0, releasefn, desc=desc) | 640 l = lock.lock(lockname, 0, releasefn, desc=desc) |
638 except error.LockHeld, inst: | 641 except error.LockHeld, inst: |
955 | 958 |
956 # XXX this is suboptimal when qrefresh'ing: we strip the current | 959 # XXX this is suboptimal when qrefresh'ing: we strip the current |
957 # head, refresh the tag cache, then immediately add a new head. | 960 # head, refresh the tag cache, then immediately add a new head. |
958 # But I think doing it this way is necessary for the "instant | 961 # But I think doing it this way is necessary for the "instant |
959 # tag cache retrieval" case to work. | 962 # tag cache retrieval" case to work. |
960 tags_.findglobaltags(self.ui, self, {}, {}) | 963 self.invalidatecaches() |
961 | 964 |
962 def walk(self, match, node=None): | 965 def walk(self, match, node=None): |
963 ''' | 966 ''' |
964 walk recursively through the directory tree or a given | 967 walk recursively through the directory tree or a given |
965 changeset, finding all files matched by the match | 968 changeset, finding all files matched by the match |