comparison hgext/mq.py @ 16252:cf17e76be4dd stable

strip: enhance repair.strip to receive a list of nodes (issue3299) Originally, mq.strip called repair.strip a single rev at a time. repair.strip stores in a backup bundle any revision greater than the revision being stripped, strips, then restores the backup with repo.addchangegroup. So, when stripping revisions on more than one topological branch, some could end up being restored from the backup bundle, only to be later removed by a subsequent repair.strip call. But repo.addchangegroup calls hooks for all those restore operations. And 9df9444e96ec changed it to delay all hook calls until the repository lock were released - by mq.strip, after stripping all revisions. Thus, the hooks could be called over revisions already removed from the repository at that point. By generating the revision lists at once inside repo.strip, we avoid calling addchangegroup for temporary restores. Incidentally, this also avoids creating many backup files for a single strip command.
author Wagner Bruna <wbruna@softwareexpress.com.br>
date Mon, 12 Mar 2012 17:02:45 -0300
parents ce292f1379ba
children 17f179805297 900eee0778d1
comparison
equal deleted inserted replaced
16244:3d26d69ef822 16252:cf17e76be4dd
1041 urev = self.qparents(repo, revs[0]) 1041 urev = self.qparents(repo, revs[0])
1042 hg.clean(repo, urev) 1042 hg.clean(repo, urev)
1043 repo.dirstate.write() 1043 repo.dirstate.write()
1044 1044
1045 self.removeundo(repo) 1045 self.removeundo(repo)
1046 for rev in revs: 1046 repair.strip(self.ui, repo, revs, backup)
1047 repair.strip(self.ui, repo, rev, backup)
1048 # strip may have unbundled a set of backed up revisions after 1047 # strip may have unbundled a set of backed up revisions after
1049 # the actual strip 1048 # the actual strip
1050 self.removeundo(repo) 1049 self.removeundo(repo)
1051 finally: 1050 finally:
1052 release(lock, wlock) 1051 release(lock, wlock)