changeset 20287:f3cef19befb1

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.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 17 Jan 2014 23:42:12 +0900
parents 760151697a4f
children b61ad01c4e73
files mercurial/revset.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Fri Jan 17 23:42:12 2014 +0900
+++ b/mercurial/revset.py	Fri Jan 17 23:42:12 2014 +0900
@@ -722,10 +722,10 @@
     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):