[PATCH evolve-ext] inhibit: don't inhibit pinned commits during rebase

Durham Goode durham at fb.com
Tue May 5 20:34:05 UTC 2015


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1430857921 25200
#      Tue May 05 13:32:01 2015 -0700
# Node ID 09cef013958f3057ca235803d544ea8eafdc6702
# Parent  ebcf23fe3032e551a220eade3fe27af7d44c8d93
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.

diff --git a/hgext/inhibit.py b/hgext/inhibit.py
--- a/hgext/inhibit.py
+++ b/hgext/inhibit.py
@@ -174,6 +174,8 @@ def transactioncallback(orig, repo, *arg
         # 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)
diff --git a/tests/test-inhibit.t b/tests/test-inhibit.t
--- a/tests/test-inhibit.t
+++ b/tests/test-inhibit.t
@@ -405,20 +405,16 @@ With severals hidden sha, rebase of one 
   |
   o  12:fe1634cbe235 add cK
   |
-  | o  11:53a94305e133 add cL
+  | @  9:55c73a90e4b4 add cJ
   | |
-  | o  10:ad78ff7d621f add cK
+  | | o  7:18214586bf78 add cJ
+  | |/
+  | o  6:cf5c4f4554ce add cH
   | |
-  | | @  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  5:5419eb264a33 add cG
+  | |
+  | o  4:98065434e5c6 add cE
+  | |
   o |  3:2db36d8066ff add cD
   | |
   o |  2:7df62a38b9bf add cC
@@ -431,8 +427,6 @@ Check that amending in the middle of a s
 
   $ hg prune 1::
   5 changesets pruned
-  $ hg prune 10::
-  2 changesets pruned
   $ hg log -G
   @  9:55c73a90e4b4 add cJ
   |


More information about the Mercurial-devel mailing list