Mercurial > hg
comparison mercurial/localrepo.py @ 9150:09a1ee498756
localrepo: add destroyed() method for strip/rollback to use (issue548).
author | Greg Ward <greg-hg@gerg.ca> |
---|---|
date | Thu, 16 Jul 2009 10:39:41 -0400 |
parents | abb7d4d43a5f |
children | f528d1a93491 |
comparison
equal
deleted
inserted
replaced
9149:abb7d4d43a5f | 9150:09a1ee498756 |
---|---|
610 self.ui.warn(_("Named branch could not be reset, " | 610 self.ui.warn(_("Named branch could not be reset, " |
611 "current branch still is: %s\n") | 611 "current branch still is: %s\n") |
612 % encoding.tolocal(self.dirstate.branch())) | 612 % encoding.tolocal(self.dirstate.branch())) |
613 self.invalidate() | 613 self.invalidate() |
614 self.dirstate.invalidate() | 614 self.dirstate.invalidate() |
615 self.destroyed() | |
615 else: | 616 else: |
616 self.ui.warn(_("no rollback information available\n")) | 617 self.ui.warn(_("no rollback information available\n")) |
617 finally: | 618 finally: |
618 release(lock, wlock) | 619 release(lock, wlock) |
619 | 620 |
907 self.hook("commit", node=hex(n), parent1=xp1, parent2=xp2) | 908 self.hook("commit", node=hex(n), parent1=xp1, parent2=xp2) |
908 return n | 909 return n |
909 finally: | 910 finally: |
910 del tr | 911 del tr |
911 lock.release() | 912 lock.release() |
913 | |
914 def destroyed(self): | |
915 '''Inform the repository that nodes have been destroyed. | |
916 Intended for use by strip and rollback, so there's a common | |
917 place for anything that has to be done after destroying history.''' | |
918 # Do nothing for now: this is a placeholder that will be used | |
919 # when we add tag caching. | |
920 # XXX it might be nice if we could take the list of destroyed | |
921 # nodes, but I don't see an easy way for rollback() to do that | |
922 pass | |
912 | 923 |
913 def walk(self, match, node=None): | 924 def walk(self, match, node=None): |
914 ''' | 925 ''' |
915 walk recursively through the directory tree or a given | 926 walk recursively through the directory tree or a given |
916 changeset, finding all files matched by the match | 927 changeset, finding all files matched by the match |