diff 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
line wrap: on
line diff
--- a/hgext/mq.py	Mon Mar 12 13:22:28 2012 +0100
+++ b/hgext/mq.py	Mon Mar 12 17:02:45 2012 -0300
@@ -1043,8 +1043,7 @@
                 repo.dirstate.write()
 
             self.removeundo(repo)
-            for rev in revs:
-                repair.strip(self.ui, repo, rev, backup)
+            repair.strip(self.ui, repo, revs, backup)
             # strip may have unbundled a set of backed up revisions after
             # the actual strip
             self.removeundo(repo)