changeset 1583:aaa65373a31b

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.
author Laurent Charignon <lcharignon@fb.com>
date Thu, 14 Jan 2016 12:02:38 -0800
parents aa42a6ad9c5c
children 6cdc0dee9d58
files hgext/inhibit.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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