Patchwork [STABLE] largefiles: don't mangle filesets when fixing up the log matcher

login
register
mail settings
Submitter Matt Harbison
Date April 18, 2015, 11:28 p.m.
Message ID <d605b9cb91cfdfaaf0d6.1429399717@Envy>
Download mbox | patch
Permalink /patch/8741/
State Accepted
Headers show

Comments

Matt Harbison - April 18, 2015, 11:28 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1429376921 14400
#      Sat Apr 18 13:08:41 2015 -0400
# Branch stable
# Node ID d605b9cb91cfdfaaf0d689a60494646f948b9c58
# Parent  e4e69cebeedd9981394786bd25b8fee14a6b89ba
largefiles: don't mangle filesets when fixing up the log matcher

The fileset-generated.t test previously failed with this:

  +  hg: parse error: unknown identifier: .hglf/modified
  +  (did you mean 'modified'?)
  +  [255]

Filesets will find the standins on their own, without any help.  While that's
useful for some things like modified(), clean(), etc., it is wrong for things
like size().  Proper fileset support for largefiles is not trivial, but this was
failing with just the extension enabled on a normal repo.
Matt Mackall - April 19, 2015, 6:02 p.m.
On Sat, 2015-04-18 at 19:28 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1429376921 14400
> #      Sat Apr 18 13:08:41 2015 -0400
> # Branch stable
> # Node ID d605b9cb91cfdfaaf0d689a60494646f948b9c58
> # Parent  e4e69cebeedd9981394786bd25b8fee14a6b89ba
> largefiles: don't mangle filesets when fixing up the log matcher

Queued for stable, thanks.

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -305,6 +305,9 @@ 
         pats = set(p)
 
         def fixpats(pat, tostandin=lfutil.standin):
+            if pat.startswith('set:'):
+                return pat
+
             kindpat = match_._patsplit(pat, None)
 
             if kindpat[0] is not None:
diff --git a/tests/test-fileset-generated.t b/tests/test-fileset-generated.t
--- a/tests/test-fileset-generated.t
+++ b/tests/test-fileset-generated.t
@@ -72,6 +72,20 @@ 
    content1_content2_content3-tracked |  1 +
    3 files changed, 3 insertions(+), 0 deletions(-)
   
+Largefiles doesn't crash
+  $ hg log -T '{rev}\n' --stat 'set:modified()' --config extensions.largefiles=
+  1
+   content1_content2_content1-tracked |  2 +-
+   content1_content2_content3-tracked |  2 +-
+   missing_content2_content3-tracked  |  1 +
+   3 files changed, 3 insertions(+), 2 deletions(-)
+  
+  0
+   content1_content1_content3-tracked |  1 +
+   content1_content2_content1-tracked |  1 +
+   content1_content2_content3-tracked |  1 +
+   3 files changed, 3 insertions(+), 0 deletions(-)
+  
   $ hg log -T '{rev}\n' --stat 'set:added()'
   1
    content1_missing_content1-tracked |  1 -
diff --git a/tests/test-largefiles-misc.t b/tests/test-largefiles-misc.t
--- a/tests/test-largefiles-misc.t
+++ b/tests/test-largefiles-misc.t
@@ -37,6 +37,13 @@ 
   A dira/dirb/largefile
   $ cd dira
   $ hg cp dirb/largefile foo/largefile
+
+TODO: Ideally, this should mention the largefile, not the standin
+  $ hg log -T '{rev}\n' --stat 'set:clean()'
+  0
+   .hglf/dira/dirb/largefile |  1 +
+   1 files changed, 1 insertions(+), 0 deletions(-)
+  
   $ hg ci -m "deep copy"
   Invoking status precommit hook
   A dira/foo/largefile