##// END OF EJS Templates
match: add some default args
Matt Mackall -
r8567:fea40a67 default
parent child Browse files
Show More
@@ -60,7 +60,7 b' def buildmatch(ui, repo, user, key):'
60 ui.debug(_('acl: %s enabled, %d entries for user %s\n') %
60 ui.debug(_('acl: %s enabled, %d entries for user %s\n') %
61 (key, len(pats), user))
61 (key, len(pats), user))
62 if pats:
62 if pats:
63 return match.match(repo.root, '', pats, [], [], 'glob')
63 return match.match(repo.root, '', pats)
64 return match.never(repo.root, '')
64 return match.never(repo.root, '')
65
65
66
66
@@ -126,7 +126,7 b' class kwtemplater(object):'
126 self.ui = ui
126 self.ui = ui
127 self.repo = repo
127 self.repo = repo
128 self.matcher = match.match(repo.root, '', [],
128 self.matcher = match.match(repo.root, '', [],
129 kwtools['inc'], kwtools['exc'], 'glob')
129 kwtools['inc'], kwtools['exc'])
130 self.restrict = kwtools['hgcmd'] in restricted.split()
130 self.restrict = kwtools['hgcmd'] in restricted.split()
131
131
132 kwmaps = self.ui.configitems('keywordmaps')
132 kwmaps = self.ui.configitems('keywordmaps')
@@ -55,7 +55,7 b' def _picktool(repo, ui, path, binary, sy'
55
55
56 # then patterns
56 # then patterns
57 for pat, tool in ui.configitems("merge-patterns"):
57 for pat, tool in ui.configitems("merge-patterns"):
58 mf = match.match(repo.root, '', [pat], [], [], 'glob')
58 mf = match.match(repo.root, '', [pat])
59 if mf(path) and check(tool, pat, symlink, False):
59 if mf(path) and check(tool, pat, symlink, False):
60 toolpath = _findtool(ui, tool)
60 toolpath = _findtool(ui, tool)
61 return (tool, '"' + toolpath + '"')
61 return (tool, '"' + toolpath + '"')
@@ -80,12 +80,12 b' def ignore(root, files, warn):'
80 return util.never
80 return util.never
81
81
82 try:
82 try:
83 ignorefunc = match.match(root, '', [], allpats, [], 'glob')
83 ignorefunc = match.match(root, '', [], allpats)
84 except util.Abort:
84 except util.Abort:
85 # Re-raise an exception where the src is the right file
85 # Re-raise an exception where the src is the right file
86 for f, patlist in pats.iteritems():
86 for f, patlist in pats.iteritems():
87 try:
87 try:
88 match.match(root, '', [], patlist, [], 'glob')
88 match.match(root, '', [], patlist)
89 except util.Abort, inst:
89 except util.Abort, inst:
90 raise util.Abort('%s: %s' % (f, inst[0]))
90 raise util.Abort('%s: %s' % (f, inst[0]))
91
91
@@ -528,7 +528,7 b' class localrepository(repo.repository):'
528 for pat, cmd in self.ui.configitems(filter):
528 for pat, cmd in self.ui.configitems(filter):
529 if cmd == '!':
529 if cmd == '!':
530 continue
530 continue
531 mf = match_.match(self.root, '', [pat], [], [], 'glob')
531 mf = match_.match(self.root, '', [pat])
532 fn = None
532 fn = None
533 params = cmd
533 params = cmd
534 for name, filterfn in self._datafilters.iteritems():
534 for name, filterfn in self._datafilters.iteritems():
@@ -48,7 +48,8 b' class exact(_match):'
48 _match.__init__(self, root, cwd, files, self.exact, False)
48 _match.__init__(self, root, cwd, files, self.exact, False)
49
49
50 class match(_match):
50 class match(_match):
51 def __init__(self, root, cwd, patterns, include, exclude, default):
51 def __init__(self, root, cwd, patterns, include=[], exclude=[],
52 default='glob'):
52 f, mf, ap = util.matcher(root, cwd, patterns, include, exclude,
53 f, mf, ap = util.matcher(root, cwd, patterns, include, exclude,
53 default)
54 default)
54 _match.__init__(self, root, cwd, f, mf, ap)
55 _match.__init__(self, root, cwd, f, mf, ap)
General Comments 0
You need to be logged in to leave comments. Login now