Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 19706:26ddce1a2a55 stable
revset: fix wrong keyword() behaviour for strings with spaces
Some changesets can be wrongly reported as matched by this predicate
due to searching in a string joined with spaces and not individually.
A test case added, which fails without this fix.
author | Alexander Plavin <alexander@plav.in> |
---|---|
date | Tue, 06 Aug 2013 00:52:06 +0400 |
parents | c1af1fb314bc |
children | 2f9d5c5256ea |
comparison
equal
deleted
inserted
replaced
19648:e90c37d7d48c | 19706:26ddce1a2a55 |
---|---|
908 # i18n: "keyword" is a keyword | 908 # i18n: "keyword" is a keyword |
909 kw = encoding.lower(getstring(x, _("keyword requires a string"))) | 909 kw = encoding.lower(getstring(x, _("keyword requires a string"))) |
910 l = [] | 910 l = [] |
911 for r in subset: | 911 for r in subset: |
912 c = repo[r] | 912 c = repo[r] |
913 t = " ".join(c.files() + [c.user(), c.description()]) | 913 if util.any(kw in encoding.lower(t) |
914 if kw in encoding.lower(t): | 914 for t in c.files() + [c.user(), c.description()]): |
915 l.append(r) | 915 l.append(r) |
916 return l | 916 return l |
917 | 917 |
918 def limit(repo, subset, x): | 918 def limit(repo, subset, x): |
919 """``limit(set, [n])`` | 919 """``limit(set, [n])`` |