rollback: always call destroyed() (regression from 1.9) stable
authorGreg Ward <greg-hg@gerg.ca>
Thu, 01 Dec 2011 17:39:30 -0500
branchstable
changeset 15604 b8d8599410da
parent 15602 2f2ca019569f
child 15607 fab28a577a38
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.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Thu Dec 01 15:55:37 2011 -0600
+++ b/mercurial/localrepo.py	Thu Dec 01 17:39:30 2011 -0500
@@ -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):