[PATCH 11 of 19 STABLE] largefiles: examine whether specified pattern is a directory in the context

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Mon Feb 27 04:46:36 CST 2012


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1330335216 -32400
# Branch stable
# Node ID 5c5ac9b4a72636ac865f68227d291a48d3c84206
# Parent  0317d98735a65b478976579bd10e75315ead234d
largefiles: examine whether specified pattern is a directory in the context

this patch adds 'inctxdirs()' which uses 'changectx.dirs()' to
examine 'directory pattern' correctly.

in fact, original implementation can show status for largefiles
specified by 'directory pattern' correctly, because 'set.difference()'
between unknown files returned by 'localrepository.status()' and all
largefiles is recognized as unknown files finally.

so this patch reduces cost of 'set.difference()' in 'working' route.

diff -r 0317d98735a6 -r 5c5ac9b4a726 hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py	Mon Feb 27 18:33:36 2012 +0900
+++ b/hgext/largefiles/reposetup.py	Mon Feb 27 18:33:36 2012 +0900
@@ -111,6 +111,9 @@
                 def inctx(file, ctx):
                     return file in ctx
 
+                def inctxdirs(f, ctx):
+                    return f in ctx.dirs()
+
                 if match is None:
                     match = match_.always(self.root, self.getcwd())
 
@@ -147,7 +150,7 @@
                     for f in files:
                         if not lfutil.isstandin(f):
                             sf = lfutil.standin(f)
-                            if inctx(sf, ctx2):
+                            if inctx(sf, ctx2) or inctxdirs(sf, ctx2):
                                 yield sf
                                 continue
                         # not 'known largefile', or 'STANDIN direct' pattern


More information about the Mercurial-devel mailing list