[PATCH 18 of 19 STABLE] largefiles: use 'dirstate.rdirs()' for directory patterns related to removed files

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


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1330335216 -32400
# Branch stable
# Node ID 4a97c1c788e3332d9ec1d9e719afa86a4f5539e4
# Parent  35c7b7ec5277e4312d3fd167cf8f07fd51bafd01
largefiles: use 'dirstate.rdirs()' for directory patterns related to removed files

this patch uses 'dirstate.rdirs()' to examine whether specified
pattern is related to removed files as 'directory pattern' or not
correctly.

diff -r 35c7b7ec5277 -r 4a97c1c788e3 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
@@ -118,7 +118,11 @@
                         return file in ctx
 
                 def inctxdirs(f, ctx):
-                    return f in ctx.dirs()
+                    if ctx.rev() is None:
+                        dirstate = repo.dirstate
+                        return f in dirstate.dirs() or f in dirstate.rdirs()
+                    else:
+                        return f in ctx.dirs()
 
                 if match is None:
                     match = match_.always(self.root, self.getcwd())
diff -r 35c7b7ec5277 -r 4a97c1c788e3 tests/test-largefiles.t
--- a/tests/test-largefiles.t	Mon Feb 27 18:33:36 2012 +0900
+++ b/tests/test-largefiles.t	Mon Feb 27 18:33:36 2012 +0900
@@ -1154,12 +1154,17 @@
 
   $ echo a > a.large
   $ hg add --large a.large
+  $ mkdir -p sub/sub
+  $ echo b > sub/sub/b.large
+  $ hg add --large sub/sub/b.large
   $ hg commit -m '#0'
   Invoking status precommit hook
   A a.large
+  A sub/sub/b.large
 
-  $ hg remove a.large
-  $ hg status -A a.large
+  $ hg remove a.large sub/sub/b.large
+  $ hg status -A a.large sub/sub
   R a.large
+  R sub/sub/b.large
 
   $ cd ..


More information about the Mercurial-devel mailing list