From patchwork Mon Apr 8 08:23:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [6, of, 8] match: make _donormalize's auditor and warn arguments optional From: Denis Laxalde X-Patchwork-Id: 39531 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Mon, 08 Apr 2019 10:23:50 +0200 # HG changeset patch # User Denis Laxalde # Date 1554650069 -7200 # Sun Apr 07 17:14:29 2019 +0200 # Node ID a544e90f7c163576fe84234b024bf0c0052d995e # Parent c7e9ddf8b24e9768d331872af1e61cd5d65c3668 match: make _donormalize's auditor and warn arguments optional Argument 'warn' is actually non-required, since there's a 'if warn:' check before usage. Argument 'auditor' is passed to pathutil.canonpath(), in which it is optional. diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -256,13 +256,13 @@ def badmatch(match, badfn): m.bad = badfn return m -def _donormalize(patterns, default, root, cwd, auditor, warn): +def _donormalize(patterns, default, root, cwd, auditor=None, warn=None): '''Convert 'kind:pat' from the patterns list to tuples with kind and normalized and rooted patterns and with listfiles expanded.''' kindpats = [] for kind, pat in [_patsplit(p, default) for p in patterns]: if kind in cwdrelativepatternkinds: - pat = pathutil.canonpath(root, cwd, pat, auditor) + pat = pathutil.canonpath(root, cwd, pat, auditor=auditor) elif kind in ('relglob', 'path', 'rootfilesin', 'rootglob'): pat = util.normpath(pat) elif kind in ('listfile', 'listfile0'):