inhibit: fix compatibility with changes in rebase
authorLaurent Charignon <lcharignon@fb.com>
Thu, 14 Jan 2016 12:02:38 -0800
changeset 1583 aaa65373a31b
parent 1582 aa42a6ad9c5c
child 1585 6cdc0dee9d58
inhibit: fix compatibility with changes in rebase Because we compute the obsolete revisions before calling _computeobsoletenotrebased lifting the inhibition stopped working since 8a8ee8338e6 in core. This patch makes it work again.
hgext/inhibit.py
--- a/hgext/inhibit.py	Sun Jan 10 10:52:24 2016 -0800
+++ b/hgext/inhibit.py	Thu Jan 14 12:02:38 2016 -0800
@@ -190,11 +190,11 @@
     finally:
         lockmod.release(tr, lock)
 
-def _computeobsoletenotrebasedwrap(orig, repo, rebasesetrevs, dest):
+def _filterobsoleterevswrap(orig, repo, rebasesetrevs, *args, **kwargs):
     repo._notinhibited = rebasesetrevs
     try:
         repo.invalidatevolatilesets()
-        r = orig(repo, rebasesetrevs, dest)
+        r = orig(repo, rebasesetrevs, *args, **kwargs)
     finally:
         del repo._notinhibited
         repo.invalidatevolatilesets()
@@ -258,9 +258,10 @@
     try:
         rebase = extensions.find('rebase')
         if rebase:
-            extensions.wrapfunction(rebase,
-                                    '_computeobsoletenotrebased',
-                                    _computeobsoletenotrebasedwrap)
+            if util.safehasattr(rebase, '_filterobsoleterevs'):
+                extensions.wrapfunction(rebase,
+                                        '_filterobsoleterevs',
+                                        _filterobsoleterevswrap)
     except KeyError:
         pass
     # There are two ways to save bookmark changes during a transation, we