# HG changeset patch # User Matt Harbison # Date 1515892034 18000 # Node ID 588d02d9208a91d440617432077a79c83e5c27b5 # Parent fc39e2bfcd709f0b04c5191295f2639357a13527 lfs: always exclude '.hg*' text files I can't think of any problematic scenarios (though things might get interesting with .hgtags, since every head is consulted). The eol extension explicitly disables handling these files, and that seems reasonable here too. diff -r fc39e2bfcd70 -r 588d02d9208a hgext/lfs/wrapper.py --- a/hgext/lfs/wrapper.py Mon Jan 15 00:16:11 2018 +0530 +++ b/hgext/lfs/wrapper.py Sat Jan 13 20:07:14 2018 -0500 @@ -130,7 +130,9 @@ textlen -= offset lfstrack = self.opener.options['lfstrack'] - if lfstrack(self.filename, textlen): + + # Always exclude hg owned files + if not self.filename.startswith('.hg') and lfstrack(self.filename, textlen): flags |= revlog.REVIDX_EXTSTORED return orig(self, text, transaction, link, p1, p2, cachedelta=cachedelta, diff -r fc39e2bfcd70 -r 588d02d9208a tests/test-lfs.t --- a/tests/test-lfs.t Mon Jan 15 00:16:11 2018 +0530 +++ b/tests/test-lfs.t Sat Jan 13 20:07:14 2018 -0500 @@ -17,7 +17,10 @@ # Commit small file $ echo s > smallfile - $ hg commit -Aqm "add small file" + $ echo '**.py = LF' > .hgeol + $ hg --config lfs.track='size(">1000B") | "path:.hgeol"' commit -Aqm "add small file" + $ hg debugdata .hgeol 0 + **.py = LF # Commit large file $ echo $LONG > largefile @@ -70,7 +73,7 @@ adding changesets adding manifests adding file changes - added 2 changesets with 2 changes to 2 files + added 2 changesets with 3 changes to 3 files calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs $ grep lfs $TESTTMP/server/.hg/requires lfs @@ -104,8 +107,8 @@ adding changesets adding manifests adding file changes - added 2 changesets with 2 changes to 2 files - new changesets b29ba743f89d:00c137947d30 + added 2 changesets with 3 changes to 3 files + new changesets 0ead593177f7:b88141481348 (run 'hg update' to get a working copy) $ grep lfs .hg/requires $TESTTMP/server/.hg/requires .hg/requires:lfs @@ -117,7 +120,7 @@ # Update to the last revision containing the large file $ hg update - 2 files updated, 0 files merged, 0 files removed, 0 files unresolved + 3 files updated, 0 files merged, 0 files removed, 0 files unresolved # Check the blobstore has been populated on update $ find .hg/store/lfs/objects | sort