[PATCH 19 of 19 STABLE] largefiles: always show status not for STANDIN but for largefiles itself

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Mon Feb 27 10:46:44 UTC 2012


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1330335216 -32400
# Branch stable
# Node ID b762afb34c7302b8bbd1f698a66c649181c8cc36
# Parent  4a97c1c788e3332d9ec1d9e719afa86a4f5539e4
largefiles: always show status not for STANDIN but for largefiles itself

original implementation shows status for largefiles:

    - as STANDIN file, if
      - no patterns to largefiles in working directory is specified, and
      - STANDIN files themselves are specified as 'file pattern'

    - as non-STANDIN file, if
      - otherwise

so, on the assumption that there are two largefiles named as 'large1'
and 'large2', 'hg status' shows status of:

    - '.hglf/large1' for 'hg status .hglf/large1'

    - 'large1' and 'large2' for 'hg status .hglf/large1 large2'

this patch forces 'hg staus' to always show status for largefiles
itself by:

    - avoiding 'performance boost' route, if STANDIN files are specified

    - examining lfdirstate also for 'STANDIN direct' pattern

diff -r 4a97c1c788e3 -r b762afb34c73 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
@@ -134,7 +134,7 @@
                 if match.files() and not match.anypats():
                     for f in match.files():
                         if lfutil.isstandin(f):
-                            continue
+                            break
                         sf = lfutil.standin(f)
                         if (inctx(sf, ctx2) or inctxdirs(sf, ctx2) or
                             (not parentworking and
@@ -207,13 +207,19 @@
 
                         def filefn(files):
                             for f in files:
-                                # ignore 'STANDIN direct' pattern
-                                if lfutil.isstandin(f):
-                                    continue
-                                sf = lfutil.standin(f)
-                                if inctx(sf, ctx2) or inctxdirs(sf, ctx2):
-                                    yield f
-                        match = match.convert(filefn)
+                                wf = lfutil.splitstandin(f)
+                                if wf:
+                                    # for 'STANDIN direct' pattern
+                                    yield wf
+                                else:
+                                    sf = lfutil.standin(f)
+                                    if inctx(sf, ctx2) or inctxdirs(sf, ctx2):
+                                        yield f
+                        def matchfn(orgmatchfn, f):
+                            return (orgmatchfn(f) or
+                                    # for 'STANDIN direct' pattern
+                                    orgmatchfn(lfutil.standin(f)))
+                        match = match.convert(filefn, matchfn)
                         # Don't waste time getting the ignored and unknown
                         # files again; we already have them
                         s = lfdirstate.status(match, [], False,
diff -r 4a97c1c788e3 -r b762afb34c73 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
@@ -986,7 +986,7 @@
 
 (4) pattern related to STANDIN (not to largefiles): performance boost
   $ hg status -A .hglf/a
-  C .hglf/a/b/c/d/e.large.txt
+  C a/b/c/d/e.large.txt
 
 (5) mixed case: no performance boost
   $ hg status -A a/b/c/x a/b/c/d



More information about the Mercurial-devel mailing list