Patchwork [7,of,8] match: make arguments of _expandsets() optional

login
register
mail settings
Submitter Denis Laxalde
Date April 8, 2019, 8:23 a.m.
Message ID <5adda8921403ce9aa216.1554711831@steppe.logilab.fr>
Download mbox | patch
Permalink /patch/39525/
State Accepted
Headers show

Comments

Denis Laxalde - April 8, 2019, 8:23 a.m.
# HG changeset patch
# User Denis Laxalde <denis@laxalde.org>
# Date 1554650218 -7200
#      Sun Apr 07 17:16:58 2019 +0200
# Node ID 5adda8921403ce9aa216a823e69ab668ac674d8f
# Parent  a544e90f7c163576fe84234b024bf0c0052d995e
match: make arguments of _expandsets() optional

Arguments 'ctx', 'listsubrepos' and 'badfn' are optional in function
body.

Patch

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -42,7 +42,7 @@  def _rematcher(regex):
     except AttributeError:
         return m.match
 
-def _expandsets(kindpats, ctx, listsubrepos, badfn):
+def _expandsets(kindpats, ctx=None, listsubrepos=False, badfn=None):
     '''Returns the kindpats list with the 'set' patterns expanded to matchers'''
     matchers = []
     other = []