Comments
Patch
@@ -76,6 +76,9 @@
configitem('lfs', 'usercache',
default=None,
)
+configitem('lfs', 'patterns',
+ default=None,
+)
configitem('lfs', 'threshold',
default=None,
)
@@ -129,6 +132,11 @@
if threshold:
pats.append("set:size('>= %s')" % threshold)
+ patterns = self.ui.config('lfs', 'patterns')
+ if patterns:
+ # TODO: Handle multiple patterns
+ pats.append(patterns)
+
m = lambda x: False
if pats:
m = scmutil.match(ctx, pats=pats, default='glob')
@@ -872,6 +872,29 @@
$ hg commit -m 'add A' -A A
$ hg rm A
$ hg commit -m 'rm A'
+ $ cat > patch.diff <<EOF
+ > # HG changeset patch
+ > 2
+ >
+ > diff --git a/a b/a
+ > new file mode 100755
+ > --- /dev/null
+ > +++ b/testfile
+ > @@ -0,0 +1,1 @@
+ > + short
+ > EOF
+
+TODO: Figure out why 'set:exec()' doesn't work here.
+ $ hg --config lfs.threshold=100MB --config lfs.patterns='*file' \
+ > import -q --bypass patch.diff
+ $ hg debugdata testfile 0
+ version https://git-lfs.github.com/spec/v1
+ oid sha256:9e886850e00759892e1ed0887cf5f9796d81e14d31f902535c3ef3b30264553a
+ size 7
+ x-is-binary 0
+ $ hg files -vr tip
+ 0 x a
+ 7 testfile
$ cd ..
Unbundling adds a requirement to a non-lfs repo, if necessary.