Patchwork [2,of,2,evolve-ext,STABLE] bundle2: wrap handler functions in mapping dictionaries

login
register
mail settings
Submitter Eric Sumner
Date April 20, 2015, 6:05 p.m.
Message ID <49e9b1b02e2218b09ace.1429553155@ericsumner-mbp1.dhcp.thefacebook.com>
Download mbox | patch
Permalink /patch/8750/
State Not Applicable
Delegated to: Pierre-Yves David
Headers show

Comments

Eric Sumner - April 20, 2015, 6:05 p.m.
# HG changeset patch
# User Eric Sumner <ericsumner@fb.com>
# Date 1429551383 14400
#      Mon Apr 20 13:36:23 2015 -0400
# Branch stable
# Node ID 49e9b1b02e2218b09acee1d90160fabc9b84df9c
# Parent  324c88e8bd8be63ab2ed83024450903e2b990d2a
bundle2: wrap handler functions in mapping dictionaries

The bundle2 code uses parttype => function dictionaries to find what handlers
it needs to run; this patch wraps the entries relevant to obsolescence exchange.

Mercurial-devel mailing list
Mercurial-devel@selenic.com
http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -145,6 +145,22 @@ 
             extensions.wrapcommand(commands.table, command, wrapper)
         for cont, funcname, wrapper in self._functionwrappers:
             extensions.wrapfunction(cont, funcname, wrapper)
+        if 'obsmarker' in exchange.pushdiscoverymapping:
+            obsmarker_orig = exchange.pushdiscoverymapping['obsmarker']
+            exchange.pushdiscoverymapping['obsmarker'] = \
+                lambda *a, **kw: _pushdiscoveryobsmarkers(obsmarker_orig, *a, **kw)
+        if 'b2x:obsmarker' in exchange.pushdiscoverymapping:
+            b2xobsmarker_orig = exchange.pushdiscoverymapping['b2x:obsmarker']
+            exchange.pushdiscoverymapping['b2x:obsmarker'] = \
+                lambda *a, **kw: _pushdiscoveryobsmarkers(b2xobsmarker_orig, *a, **kw)
+        if 'obsmarker' in exchange.getbundle2partsmapping:
+            obsmarkerpart_orig = exchange.getbundle2partsmapping['obsmarker']
+            exchange.getbundle2partsmapping['obsmarker'] = \
+                lambda *a, **kw: _getbundleobsmarkerpart(obsmarkerpart_orig, *a, **kw)
+        if 'b2x:obsmarker' in exchange.getbundle2partsmapping:
+            b2xobsmarkerpart_orig = exchange.getbundle2partsmapping['obsmarker']
+            exchange.getbundle2partsmapping['b2x:obsmarker'] = \
+                lambda *a, **kw: _getbundleobsmarkerpart(obsmarkerpart_orig, *a, **kw)
         for c in self._uicallables:
             c(ui)
_______________________________________________