[PATCH 1 of 4 stable v2] largefiles: test coverage of handling of store corruption
Mads Kiilerich
mads at kiilerich.com
Fri Oct 23 19:27:55 UTC 2015
# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1445628449 -7200
# Fri Oct 23 21:27:29 2015 +0200
# Branch stable
# Node ID dcb31859ffc73331a3ea337ac5df5001a75d57a5
# Parent c7d30fdb13b229537269030c94c7b2540b6d34a0
largefiles: test coverage of handling of store corruption
This reveals that update might put a corrupted largefile in the working
directory where it will show up as modified and ready for commit.
diff --git a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t
--- a/tests/test-largefiles-cache.t
+++ b/tests/test-largefiles-cache.t
@@ -179,3 +179,25 @@ conditional above.
$ find src/.hg/largefiles/* | egrep "(dirstate|$hash)" | sort
src/.hg/largefiles/dirstate
src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
+
+Inject corruption into the largefiles store and see how update handles that:
+
+ $ cd src
+ $ hg up -qC
+ $ cat large
+ modified
+ $ rm large
+ $ cat .hglf/large
+ e2fb5f2139d086ded2cb600d5a91a196e76bf020
+ $ mv .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 ..
+ $ echo corruption > .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
+(the following update will put the corrupted file into the working directory
+where it will show up as a change)
+ $ hg up -C
+ getting changed largefiles
+ 1 largefiles updated, 0 removed
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg st
+ M large
+ ? z
+ $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
More information about the Mercurial-devel
mailing list