Patchwork [3,of,6,py3] config: pass some optional args as keywords

login
register
mail settings
Submitter Augie Fackler
Date March 3, 2017, 7:30 p.m.
Message ID <2ab40e1c47207da01974.1488569406@imladris.local>
Download mbox | patch
Permalink /patch/18896/
State Accepted
Headers show

Comments

Augie Fackler - March 3, 2017, 7:30 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1488563749 18000
#      Fri Mar 03 12:55:49 2017 -0500
# Node ID 2ab40e1c47207da01974913a46796967e19242bd
# Parent  0034a661fbdc1e29e51fe8e2877467204282f669
config: pass some optional args as keywords

This makes it a little more obvious that self.read is being passed as
include, which took me a moment to figure out.
Yuya Nishihara - March 5, 2017, 6:25 a.m.
On Fri, 03 Mar 2017 14:30:06 -0500, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <raf@durin42.com>
> # Date 1488563749 18000
> #      Fri Mar 03 12:55:49 2017 -0500
> # Node ID 2ab40e1c47207da01974913a46796967e19242bd
> # Parent  0034a661fbdc1e29e51fe8e2877467204282f669
> config: pass some optional args as keywords

Nice. Queued this, thanks.

Patch

diff --git a/mercurial/config.py b/mercurial/config.py
--- a/mercurial/config.py
+++ b/mercurial/config.py
@@ -173,4 +173,5 @@  class config(object):
         assert fp.mode == r'rb', ('config files must be opened'
                                   ' in binary mode, got fp=%r mode=%r' % (
                                       fp, fp.mode))
-        self.parse(path, fp.read(), sections, remap, self.read)
+        self.parse(path, fp.read(),
+                   sections=sections, remap=remap, include=self.read)