# HG changeset patch # User FUJIWARA Katsunori # Date 1389969732 -32400 # Node ID 189fe1b3d16ae0035424cedce46a5b7b542644ba # Parent e1e6ddaef299b245851f36eb01ec7d74876a477e 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. diff -r e1e6ddaef299 -r 189fe1b3d16a mercurial/revset.py --- 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':