# HG changeset patch # User Durham Goode # Date 1428360240 25200 # Node ID 62229e7451f7dbe566c42ff21f8009684d8c6712 # Parent 1e3c607cf4a5aebb136442e5f8613cf6b3c7cd07 inhibit: wrap repo.commit to inhibit nodes Rebase was failing if you rebased a commit, stripped it, then rebased it again. This is because the node was still hidden and we needed repo.commit to uninhibit it. diff -r 1e3c607cf4a5 -r 62229e7451f7 hgext/inhibit.py --- a/hgext/inhibit.py Wed Apr 29 11:42:06 2015 -0700 +++ b/hgext/inhibit.py Mon Apr 06 15:44:00 2015 -0700 @@ -48,6 +48,11 @@ obsinhibit.add(raw[i:i+20]) return obsinhibit + def commit(self, *args, **kwargs): + newnode = super(obsinhibitedrepo, self).commit(*args, **kwargs) + _inhibitmarkers(repo, [newnode]) + return newnode + # Wrapping this to inhibit obsolete revs resulting from a transaction extensions.wrapfunction(localrepo.localrepository, 'transaction', transactioncallback) diff -r 1e3c607cf4a5 -r 62229e7451f7 tests/test-inhibit.t --- a/tests/test-inhibit.t Wed Apr 29 11:42:06 2015 -0700 +++ b/tests/test-inhibit.t Mon Apr 06 15:44:00 2015 -0700 @@ -495,4 +495,35 @@ | o 0:54ccbc537fc2 add cA +Check that rebasing a commit twice makes the commit visible again + $ hg rebase -d 18 -r 16 --keep + rebasing 16:a438c045eb37 "add cN" + $ hg log -r 14:: -G + o 19:104eed5354c7 add cN + | + @ 18:210589181b14 add cM + | + | o 16:a438c045eb37 add cN + | | + | o 15:2d66e189f5b5 add cM + |/ + o 14:d66ccb8c5871 add cL + | + $ hg prune -r 104eed5354c7 + 1 changesets pruned + $ hg rebase -d 18 -r 16 --keep + rebasing 16:a438c045eb37 "add cN" + $ hg log -r 14:: -G + o 19:104eed5354c7 add cN + | + @ 18:210589181b14 add cM + | + | o 16:a438c045eb37 add cN + | | + | o 15:2d66e189f5b5 add cM + |/ + o 14:d66ccb8c5871 add cL + | + $ hg prune -r 104eed5354c7 + 1 changesets pruned