[PATCH STABLE] rollback: always call destroyed() (regression from 1.9)

Greg Ward greg-hg at gerg.ca
Thu Dec 1 16:45:14 CST 2011


# HG changeset patch
# User Greg Ward <greg-hg at gerg.ca>
# Date 1322779170 18000
# Branch stable
# Node ID b8d8599410dac7a757b059e30f1053e55e77fb3f
# Parent  2f2ca019569feddfc39eae4f1cda0b3da62d4e00
rollback: always call destroyed() (regression from 1.9)

The contract for repo.destroyed() is that it is called whenever
changesets are destroyed, either by strip or by rollback. That
contract was inadvertently broken in 7c26ce9edbd2, when we made a
chunk of code conditional on destroying one of the working dir's
parents. Oops: it doesn't matter *which* changesets are destroyed or
what their relationship is to the working dir, we should call
repo.destroyed() whenever we destroy changesets.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -820,7 +820,6 @@
                         % self.dirstate.branch())
 
             self.dirstate.invalidate()
-            self.destroyed()
             parents = tuple([p.rev() for p in self.parents()])
             if len(parents) > 1:
                 ui.status(_('working directory now based on '
@@ -828,6 +827,7 @@
             else:
                 ui.status(_('working directory now based on '
                             'revision %d\n') % parents)
+        self.destroyed()
         return 0
 
     def invalidatecaches(self):


More information about the Mercurial-devel mailing list