comparison mercurial/scmutil.py @ 26325:cce8ebd31407

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 00:59:26 -0700
parents a112fffdb632
children 58218b0e6005
comparison
equal deleted inserted replaced
26324:4a8e21578e14 26325:cce8ebd31407
751 ret.extend(globbed) 751 ret.extend(globbed)
752 continue 752 continue
753 ret.append(kindpat) 753 ret.append(kindpat)
754 return ret 754 return ret
755 755
756 def matchandpats(ctx, pats=[], opts={}, globbed=False, default='relpath', 756 def matchandpats(ctx, pats=(), opts={}, globbed=False, default='relpath',
757 badfn=None): 757 badfn=None):
758 '''Return a matcher and the patterns that were used. 758 '''Return a matcher and the patterns that were used.
759 The matcher will warn about bad matches, unless an alternate badfn callback 759 The matcher will warn about bad matches, unless an alternate badfn callback
760 is provided.''' 760 is provided.'''
761 if pats == ("",): 761 if pats == ("",):