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

login
register
mail settings
Submitter Pierre-Yves David
Date July 2, 2017, 2:57 a.m.
Message ID <f92fcf4884e2f2959f33.1498964250@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21894/
State Accepted
Headers show

Comments

Pierre-Yves David - July 2, 2017, 2:57 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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)