[PATCH] add test-fncache

Adrian Buehlmann adrian at cadifra.com
Wed Oct 29 07:42:28 CDT 2008


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1225283855 -3600
# Node ID a3871028aacfd7102a766bd4cb986e3ff73c255f
# Parent  ddab62b2fec47fd89755bc15f8bbda68a404cefe
add test-fncache

diff --git a/tests/test-fncache b/tests/test-fncache
new file mode 100755
--- /dev/null
+++ b/tests/test-fncache
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+echo "% init repo1"
+hg init repo1
+cd repo1
+
+echo
+echo "% add a; ci"
+echo "some text" > a
+hg add
+hg ci -d '0 0' -m first
+
+echo
+echo "% cat .hg/store/fncache"
+cat .hg/store/fncache
+
+echo
+echo "% add a.i/b; ci"
+mkdir a.i
+echo "some other text" > a.i/b
+hg add
+hg ci -d '0 0' -m second
+
+echo
+echo "% cat .hg/store/fncache"
+cat .hg/store/fncache
+
+echo
+echo "% add a.i.hg/c; ci"
+mkdir a.i.hg
+echo "yet another text" > a.i.hg/c
+hg add
+hg ci -d '0 0' -m third
+
+echo
+echo "% cat .hg/store/fncache"
+cat .hg/store/fncache
+
+echo
+echo "% hg verify"
+hg verify
+
+echo
+echo "% rm .hg/store/fncache"
+rm .hg/store/fncache
+
+echo
+echo "% hg verify"
+hg verify
+
+exit 0
diff --git a/tests/test-fncache.out b/tests/test-fncache.out
new file mode 100644
--- /dev/null
+++ b/tests/test-fncache.out
@@ -0,0 +1,43 @@
+% init repo1
+
+% add a; ci
+adding a
+
+% cat .hg/store/fncache
+data/a.i
+
+% add a.i/b; ci
+adding a.i/b
+
+% cat .hg/store/fncache
+data/a.i
+data/a.i.hg/b.i
+
+% add a.i.hg/c; ci
+adding a.i.hg/c
+
+% cat .hg/store/fncache
+data/a.i
+data/a.i.hg/b.i
+data/a.i.hg.hg/c.i
+
+% hg verify
+checking changesets
+checking manifests
+crosschecking files in changesets and manifests
+checking files
+3 files, 3 changesets, 3 total revisions
+
+% rm .hg/store/fncache
+
+% hg verify
+checking changesets
+checking manifests
+crosschecking files in changesets and manifests
+checking files
+ data/a.i at 0: missing revlog!
+ data/a.i.hg.hg/c.i at 0: missing revlog!
+ data/a.i.hg/b.i at 0: missing revlog!
+3 files, 3 changesets, 3 total revisions
+3 integrity errors encountered!
+(first damaged changeset appears to be 0)


More information about the Mercurial-devel mailing list