# HG changeset patch # User FUJIWARA Katsunori # Date 2014-01-17 14:42:12 # Node ID f3cef19befb10fc88adbdfa0f86c704814809373 # Parent 760151697a4fe2ea4c4c98565dddba4c5df69186 revset: avoid loop for "match.files()" having always one element for efficiency This patch avoids the loop for "match.files()" having always one element in revset predicate "filelog()" for efficiency: "match" object "m" is constructed with "[pat]" as "patterns" argument. diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -722,10 +722,10 @@ def filelog(repo, subset, x): s = set() if not matchmod.patkind(pat): - for f in m.files(): - fl = repo.file(f) - for fr in fl: - s.add(fl.linkrev(fr)) + f = m.files()[0] + fl = repo.file(f) + for fr in fl: + s.add(fl.linkrev(fr)) else: for f in repo[None]: if m(f):