comparison mercurial/localrepo.py @ 15604:b8d8599410da stable

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.
author Greg Ward <greg-hg@gerg.ca>
date Thu, 01 Dec 2011 17:39:30 -0500
parents c519cd8f0169
children ec8a49c46d7e 417127af3996
comparison
equal deleted inserted replaced
15602:2f2ca019569f 15604:b8d8599410da
818 ui.warn(_('named branch could not be reset: ' 818 ui.warn(_('named branch could not be reset: '
819 'current branch is still \'%s\'\n') 819 'current branch is still \'%s\'\n')
820 % self.dirstate.branch()) 820 % self.dirstate.branch())
821 821
822 self.dirstate.invalidate() 822 self.dirstate.invalidate()
823 self.destroyed()
824 parents = tuple([p.rev() for p in self.parents()]) 823 parents = tuple([p.rev() for p in self.parents()])
825 if len(parents) > 1: 824 if len(parents) > 1:
826 ui.status(_('working directory now based on ' 825 ui.status(_('working directory now based on '
827 'revisions %d and %d\n') % parents) 826 'revisions %d and %d\n') % parents)
828 else: 827 else:
829 ui.status(_('working directory now based on ' 828 ui.status(_('working directory now based on '
830 'revision %d\n') % parents) 829 'revision %d\n') % parents)
830 self.destroyed()
831 return 0 831 return 0
832 832
833 def invalidatecaches(self): 833 def invalidatecaches(self):
834 try: 834 try:
835 delattr(self, '_tagscache') 835 delattr(self, '_tagscache')