revset: narrow scope of the variable referred only in specific code path
This patch narrows scope of the variable "m" in the function for
revset predicate "contains()", because it is referred only in "else"
code path of "if not matchmod.patkind(pat)" examination.
--- a/mercurial/revset.py Fri Jan 17 12:46:29 2014 +0100
+++ b/mercurial/revset.py Fri Jan 17 23:42:12 2014 +0900
@@ -528,13 +528,13 @@
"""
# i18n: "contains" is a keyword
pat = getstring(x, _("contains requires a pattern"))
- m = None
s = []
if not matchmod.patkind(pat):
for r in subset:
if pat in repo[r]:
s.append(r)
else:
+ m = None
for r in subset:
c = repo[r]
if not m or matchmod.patkind(pat) == 'set':