[PATCH 02 of 18] zeroconf: blindly forward extra argument to the core config method

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat Jul 1 22:57:30 EDT 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1498939037 -7200
#      Sat Jul 01 21:57:17 2017 +0200
# Node ID f92fcf4884e2f2959f33011fb4996cca8c594e65
# Parent  6d678ab1b10d0fddc73003d21aa3c7ec43194e2e
# EXP-Topic config.register.core
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r f92fcf4884e2
zeroconf: blindly forward extra argument to the core config method

The new default value handling is simpler if we let the original function handle
everything.

diff --git a/hgext/zeroconf/__init__.py b/hgext/zeroconf/__init__.py
--- a/hgext/zeroconf/__init__.py
+++ b/hgext/zeroconf/__init__.py
@@ -167,12 +167,12 @@ def getzcpaths():
                                   value.properties.get("path", "/"))
         yield "zc-" + name, url
 
-def config(orig, self, section, key, default=None, untrusted=False):
+def config(orig, self, section, key, *args, **kwargs):
     if section == "paths" and key.startswith("zc-"):
         for name, path in getzcpaths():
             if name == key:
                 return path
-    return orig(self, section, key, default, untrusted)
+    return orig(self, section, key, *args, **kwargs)
 
 def configitems(orig, self, section, *args, **kwargs):
     repos = orig(self, section, *args, **kwargs)


More information about the Mercurial-devel mailing list