Mercurial > hg
comparison mercurial/scmutil.py @ 26328:188c1e9506f5
match: remove a mutable default argument
Mutable default arguments are know to the state of California to cause bugs. We
added support for None in the underlying function in the parent commit.
therefore we do not need to do anything but passing None.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 24 Sep 2015 01:00:43 -0700 |
parents | c786dd6cae57 |
children | d9537ce64f3a |
comparison
equal
deleted
inserted
replaced
26327:c786dd6cae57 | 26328:188c1e9506f5 |
---|---|
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=None, globbed=False, default='relpath', |
782 badfn=None): | |
782 '''Return a matcher that will warn about bad matches.''' | 783 '''Return a matcher that will warn about bad matches.''' |
783 return matchandpats(ctx, pats, opts, globbed, default, badfn=badfn)[0] | 784 return matchandpats(ctx, pats, opts, globbed, default, badfn=badfn)[0] |
784 | 785 |
785 def matchall(repo): | 786 def matchall(repo): |
786 '''Return a matcher that will efficiently match everything.''' | 787 '''Return a matcher that will efficiently match everything.''' |