diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py index 843d71136c..86189e1e4f 100644 --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -612,6 +612,7 @@ class localrepository(repo.repository): % encoding.tolocal(self.dirstate.branch())) self.invalidate() self.dirstate.invalidate() + self.destroyed() else: self.ui.warn(_("no rollback information available\n")) finally: @@ -910,6 +911,16 @@ class localrepository(repo.repository): del tr lock.release() + def destroyed(self): + '''Inform the repository that nodes have been destroyed. + Intended for use by strip and rollback, so there's a common + place for anything that has to be done after destroying history.''' + # Do nothing for now: this is a placeholder that will be used + # when we add tag caching. + # XXX it might be nice if we could take the list of destroyed + # nodes, but I don't see an easy way for rollback() to do that + pass + def walk(self, match, node=None): ''' walk recursively through the directory tree or a given diff --git a/mercurial/repair.py b/mercurial/repair.py index 942daf6e55..f4d8d2641b 100644 --- a/mercurial/repair.py +++ b/mercurial/repair.py @@ -142,3 +142,4 @@ def strip(ui, repo, node, backup="all"): if backup != "strip": os.unlink(chgrpfile) + repo.destroyed()