inhibit: don't inhibit pinned commits during rebase
authorDurham Goode <durham@fb.com>
Tue, 05 May 2015 13:32:01 -0700
changeset 1321 8fa74845eb1f
parent 1320 b5cd96395867
child 1322 f3e0686a63a1
inhibit: don't inhibit pinned commits during rebase During a rebase we pin certain commits to always be visible. This caused the inhibit extension to inhibit them when a transaction closed. Let's make inhibit aware of such pins and not obsolete them.
hgext/inhibit.py
tests/test-inhibit.t
--- a/hgext/inhibit.py	Mon May 04 16:56:46 2015 -0700
+++ b/hgext/inhibit.py	Tue May 05 13:32:01 2015 -0700
@@ -184,6 +184,8 @@
         # At the end of the transaction we catch all the new visible and
         # obsolete commit to inhibit them
         visibleobsolete = repo.revs('(not hidden()) and obsolete()')
+        ignoreset = set(getattr(repo, '_rebaseset', []))
+        visibleobsolete = list(r for r in visibleobsolete if r not in ignoreset)
         if visibleobsolete:
             _inhibitmarkers(repo, [repo[r].node() for r in visibleobsolete])
     transaction = orig(repo, *args, **kwargs)
--- a/tests/test-inhibit.t	Mon May 04 16:56:46 2015 -0700
+++ b/tests/test-inhibit.t	Tue May 05 13:32:01 2015 -0700
@@ -404,20 +404,16 @@
   |
   o  12:fe1634cbe235 add cK
   |
-  | o  11:53a94305e133 add cL
-  | |
-  | o  10:ad78ff7d621f add cK
+  | @  9:55c73a90e4b4 add cJ
   | |
-  | | @  9:55c73a90e4b4 add cJ
-  | | |
-  | | | o  7:18214586bf78 add cJ
-  | | |/
-  | | o  6:cf5c4f4554ce add cH
-  | | |
-  | | o  5:5419eb264a33 add cG
-  | | |
-  | | o  4:98065434e5c6 add cE
+  | | o  7:18214586bf78 add cJ
   | |/
+  | o  6:cf5c4f4554ce add cH
+  | |
+  | o  5:5419eb264a33 add cG
+  | |
+  | o  4:98065434e5c6 add cE
+  | |
   o |  3:2db36d8066ff add cD
   | |
   o |  2:7df62a38b9bf add cC
@@ -430,8 +426,6 @@
 
   $ hg prune 1::
   5 changesets pruned
-  $ hg prune 10::
-  2 changesets pruned
   $ hg log -G
   @  9:55c73a90e4b4 add cJ
   |