Mercurial > hg-stable
diff tests/test-lfs.t @ 35807:4425790f2373 stable
lfs: don't require the .hglfs file to be tracked to control the policy
The .hgignore file doesn't need to be tracked, nor does the git equivalent of
this file. I'm still a little concerned about the effects of forgetting to
commit this file. But the fact that conversions maintain the hashes if only the
normal vs external storage changes, should make this less risky.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 29 Jan 2018 21:42:18 -0500 |
parents | d5288b966e2f |
children | d031609b3cb7 0b79f99fd7b0 |
line wrap: on
line diff
--- a/tests/test-lfs.t Sat Jan 27 21:50:04 2018 -0500 +++ b/tests/test-lfs.t Mon Jan 29 21:42:18 2018 -0500 @@ -984,27 +984,28 @@ > ** = size(">10B") > EOF -The LFS policy takes effect as the .hglfs file is committed +The LFS policy takes effect without tracking the .hglfs file $ echo 'largefile' > lfs.test $ echo '012345678901234567890' > nolfs.exclude $ echo '01234567890123456' > lfs.catchall - $ hg ci -Aqm 'added .hglfs' + $ hg add * + $ hg ci -qm 'before add .hglfs' $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n' 2: lfs.catchall: d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9 lfs.test: 5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c -The existing .hglfs file is used even when it is not in the 'A' or 'M' states +The .hglfs file works when tracked $ echo 'largefile2' > lfs.test $ echo '012345678901234567890a' > nolfs.exclude $ echo '01234567890123456a' > lfs.catchall - $ hg ci -qm 'unmodified .hglfs' + $ hg ci -Aqm 'after adding .hglfs' $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n' 3: lfs.catchall: 31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573 lfs.test: 8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6 -Excluding the .hglfs file from the commit postpones the policy change +The LFS policy stops when the .hglfs is gone $ hg rm .hglfs $ echo 'largefile3' > lfs.test @@ -1012,17 +1013,7 @@ $ echo '01234567890123456abc' > lfs.catchall $ hg ci -qm 'file test' -X .hglfs $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n' - 4: lfs.catchall: 6747cfb1b83965b4a884e7a6061813ae31e4122028bc6a88d2ac5e5f9e05c5af - lfs.test: 3f40b70c2294e91e0fa789ebcf73c5a1d1c7aef270f83e477e40cb0513237e8c - -The policy change takes effect when the .hglfs is committed - - $ echo 'largefile4' > lfs.test - $ echo '012345678901234567890abcdef' > nolfs.exclude - $ echo '01234567890123456abcdef' > lfs.catchall - $ hg ci -qm 'file test' - $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n' - 5: + 4: $ cd ..