diff hgext/largefiles/reposetup.py @ 16110:41417443b7d0 stable

largefiles: check whether specified patterns are related to largefiles strictly current 'lfiles_repo.status()' implementation examines whether specified patterns are related to largefiles in working directory (not to STANDIN) or not by NOT-EMPTY-NESS of below list: [f for f in match.files() if f in lfdirstate] but it can not be assumed that all in 'match.files()' are file itself exactly, because user may only specify part of path to match whole under subdirectories recursively. above examination will mis-recognize such pattern as 'not related to largefiles', and executes normal 'status()' procedure. so, 'hg status' shows '?'(unknown) status for largefiles in working directory unexpectedly. this patch examines relation of pattern to largefiles by applying 'match()' on each entries in lfdirstate and checking wheter there is no matched entry. it may increase cost of examination, because it causes of full scan of entries in lfdirstate. so this patch uses normal for-loop instead of list comprehensions, to decrease cost when matching is found.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 15 Feb 2012 23:01:09 +0900
parents bf502ccc46d7
children f346de4dff57
line wrap: on
line diff
--- a/hgext/largefiles/reposetup.py	Fri Feb 10 16:52:32 2012 -0600
+++ b/hgext/largefiles/reposetup.py	Wed Feb 15 23:01:09 2012 +0900
@@ -118,8 +118,10 @@
                 # handle it -- thus gaining a big performance boost.
                 lfdirstate = lfutil.openlfdirstate(ui, self)
                 if match.files() and not match.anypats():
-                    matchedfiles = [f for f in match.files() if f in lfdirstate]
-                    if not matchedfiles:
+                    for f in lfdirstate:
+                        if match(f):
+                            break
+                    else:
                         return super(lfiles_repo, self).status(node1, node2,
                                 match, listignored, listclean,
                                 listunknown, listsubrepos)