# HG changeset patch # User Matt Mackall # Date 2009-05-24 07:56:14 # Node ID fea40a677d43ce7c543fea28488e582ab79b68e3 # Parent 744d6322b05bfa7613c8b9fa565ddf43b8ed3f37 match: add some default args diff --git a/hgext/acl.py b/hgext/acl.py --- a/hgext/acl.py +++ b/hgext/acl.py @@ -60,7 +60,7 @@ def buildmatch(ui, repo, user, key): ui.debug(_('acl: %s enabled, %d entries for user %s\n') % (key, len(pats), user)) if pats: - return match.match(repo.root, '', pats, [], [], 'glob') + return match.match(repo.root, '', pats) return match.never(repo.root, '') diff --git a/hgext/keyword.py b/hgext/keyword.py --- a/hgext/keyword.py +++ b/hgext/keyword.py @@ -126,7 +126,7 @@ class kwtemplater(object): self.ui = ui self.repo = repo self.matcher = match.match(repo.root, '', [], - kwtools['inc'], kwtools['exc'], 'glob') + kwtools['inc'], kwtools['exc']) self.restrict = kwtools['hgcmd'] in restricted.split() kwmaps = self.ui.configitems('keywordmaps') diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py --- a/mercurial/filemerge.py +++ b/mercurial/filemerge.py @@ -55,7 +55,7 @@ def _picktool(repo, ui, path, binary, sy # then patterns for pat, tool in ui.configitems("merge-patterns"): - mf = match.match(repo.root, '', [pat], [], [], 'glob') + mf = match.match(repo.root, '', [pat]) if mf(path) and check(tool, pat, symlink, False): toolpath = _findtool(ui, tool) return (tool, '"' + toolpath + '"') diff --git a/mercurial/ignore.py b/mercurial/ignore.py --- a/mercurial/ignore.py +++ b/mercurial/ignore.py @@ -80,12 +80,12 @@ def ignore(root, files, warn): return util.never try: - ignorefunc = match.match(root, '', [], allpats, [], 'glob') + ignorefunc = match.match(root, '', [], allpats) except util.Abort: # Re-raise an exception where the src is the right file for f, patlist in pats.iteritems(): try: - match.match(root, '', [], patlist, [], 'glob') + match.match(root, '', [], patlist) except util.Abort, inst: raise util.Abort('%s: %s' % (f, inst[0])) diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -528,7 +528,7 @@ class localrepository(repo.repository): for pat, cmd in self.ui.configitems(filter): if cmd == '!': continue - mf = match_.match(self.root, '', [pat], [], [], 'glob') + mf = match_.match(self.root, '', [pat]) fn = None params = cmd for name, filterfn in self._datafilters.iteritems(): diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -48,7 +48,8 @@ class exact(_match): _match.__init__(self, root, cwd, files, self.exact, False) class match(_match): - def __init__(self, root, cwd, patterns, include, exclude, default): + def __init__(self, root, cwd, patterns, include=[], exclude=[], + default='glob'): f, mf, ap = util.matcher(root, cwd, patterns, include, exclude, default) _match.__init__(self, root, cwd, f, mf, ap)