prune: fix pruning w/ bookmarks and inhibit
authorDurham Goode <durham@fb.com>
Tue, 07 Apr 2015 14:26:03 -0700
changeset 1294 d1c29db2e055
parent 1293 dc5528e04c06
child 1295 1ac05eef72ca
prune: fix pruning w/ bookmarks and inhibit Previously prune would create the obsolesence markers, then try to fix up the bookmarks. With inhibit enabled, the act of closing a transaction for the bookmark step caused it to unhide commits that were trying to be pruned. The fix is to put the whole thing in a transaction.
hgext/evolve.py
tests/test-inhibit.t
--- a/hgext/evolve.py	Tue Apr 07 14:08:18 2015 -0700
+++ b/hgext/evolve.py	Tue Apr 07 14:26:03 2015 -0700
@@ -1801,6 +1801,7 @@
     try:
         wlock = repo.wlock()
         lock = repo.lock()
+        tr = repo.transaction('prune')
         # defines pruned changesets
         precs = []
         revs.sort()
@@ -1891,7 +1892,11 @@
                     updatebookmarks = _bookmarksupdater(repo, ctx.node())
                     updatebookmarks(dest.node())
                     break
+
+        tr.close()
     finally:
+        if tr:
+            tr.release()
         lockmod.release(lock, wlock)
 
 @command('amend|refresh',
--- a/tests/test-inhibit.t	Tue Apr 07 14:08:18 2015 -0700
+++ b/tests/test-inhibit.t	Tue Apr 07 14:26:03 2015 -0700
@@ -525,5 +525,18 @@
   |/
   o  14:d66ccb8c5871 add cL
   |
-  $ hg prune -r 104eed5354c7
-  1 changesets pruned
+
+Test prunestrip
+
+  $ hg book foo -r 104eed5354c7
+  $ hg strip -r 210589181b14 --config experimental.prunestrip=True --config extensions.strip=
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  working directory now at d66ccb8c5871
+  2 changesets pruned
+  $ hg log -r 14:: -G -T '{rev}:{node|short} {desc|firstline} {bookmarks}\n'
+  o  16:a438c045eb37 add cN
+  |
+  o  15:2d66e189f5b5 add cM
+  |
+  @  14:d66ccb8c5871 add cL foo
+  |