comparison mercurial/scmutil.py @ 26327:c786dd6cae57

match: remove a mutable default argument Mutable default arguments are know to the state of California to cause bugs.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 24 Sep 2015 01:00:25 -0700
parents 58218b0e6005
children 188c1e9506f5
comparison
equal deleted inserted replaced
26326:58218b0e6005 26327:c786dd6cae57
776 776
777 if m.always(): 777 if m.always():
778 pats = [] 778 pats = []
779 return m, pats 779 return m, pats
780 780
781 def match(ctx, pats=[], opts={}, globbed=False, default='relpath', badfn=None): 781 def match(ctx, pats=(), opts={}, globbed=False, default='relpath', badfn=None):
782 '''Return a matcher that will warn about bad matches.''' 782 '''Return a matcher that will warn about bad matches.'''
783 return matchandpats(ctx, pats, opts, globbed, default, badfn=badfn)[0] 783 return matchandpats(ctx, pats, opts, globbed, default, badfn=badfn)[0]
784 784
785 def matchall(repo): 785 def matchall(repo):
786 '''Return a matcher that will efficiently match everything.''' 786 '''Return a matcher that will efficiently match everything.'''