largefiles: don't mangle filesets when fixing up the log matcher stable
authorMatt Harbison <matt_harbison@yahoo.com>
Sat, 18 Apr 2015 13:08:41 -0400
branchstable
changeset 24813 2553ef7355ab
parent 24812 e4e69cebeedd
child 24814 60e4258b2052
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.
hgext/largefiles/overrides.py
tests/test-fileset-generated.t
tests/test-largefiles-misc.t
--- a/hgext/largefiles/overrides.py	Sat Apr 18 00:34:38 2015 -0400
+++ b/hgext/largefiles/overrides.py	Sat Apr 18 13:08:41 2015 -0400
@@ -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:
--- a/tests/test-fileset-generated.t	Sat Apr 18 00:34:38 2015 -0400
+++ b/tests/test-fileset-generated.t	Sat Apr 18 13:08:41 2015 -0400
@@ -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 -
--- a/tests/test-largefiles-misc.t	Sat Apr 18 00:34:38 2015 -0400
+++ b/tests/test-largefiles-misc.t	Sat Apr 18 13:08:41 2015 -0400
@@ -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