Patchwork [evolve-ext] inhibit: fix compatibility with changes in rebase

login
register
mail settings
Submitter Laurent Charignon
Date Jan. 14, 2016, 8:02 p.m.
Message ID <14d2db49647299953a78.1452801779@lcharignon-mbp.dhcp.thefacebook.com>
Download mbox | patch
Permalink /patch/12766/
State Accepted
Delegated to: Pierre-Yves David
Headers show

Comments

Laurent Charignon - Jan. 14, 2016, 8:02 p.m.
# HG changeset patch
# User Laurent Charignon <lcharignon@fb.com>
# Date 1452801758 28800
#      Thu Jan 14 12:02:38 2016 -0800
# Node ID 14d2db49647299953a786b31a8f3a7f645453c59
# Parent  4f83b2d2d20de55b2a63910ff10204af9106fd26
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.
Pierre-Yves David - Jan. 17, 2016, 7:30 p.m.
On 01/14/2016 12:02 PM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon@fb.com>
> # Date 1452801758 28800
> #      Thu Jan 14 12:02:38 2016 -0800
> # Node ID 14d2db49647299953a786b31a8f3a7f645453c59
> # Parent  4f83b2d2d20de55b2a63910ff10204af9106fd26
> inhibit: fix compatibility with changes in rebase

Pushed to main, thanks

Patch

diff --git a/hgext/inhibit.py b/hgext/inhibit.py
--- a/hgext/inhibit.py
+++ b/hgext/inhibit.py
@@ -190,11 +190,11 @@  def _createmarkers(orig, repo, relations
     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 @@  def extsetup(ui):
     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