annotate tests/test-push-validation @ 10418:5fc090ba08a6

localrepo: add optional validation (defaults to off) for incoming changes This verifies that all manifests are present for incoming changes, and all files for those manifests are also present. This is a simple first-pass, and could be better, but seems like a valuable thing to have, as I've seen pushes in the past that propagated revlog corruption.
author Augie Fackler <durin42@gmail.com>
date Thu, 11 Feb 2010 16:37:43 -0600
parents
children b26c4a89a143
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10418
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
1 #!/bin/sh
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
2
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
3 STRIP=`pwd`
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
4
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
5 hg init test
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
6 cd test
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
7 cat > .hg/hgrc <<EOF
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
8 [server]
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
9 validate=1
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
10 EOF
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
11 echo alpha > alpha
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
12 echo beta > beta
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
13 hg addr
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
14 hg ci -m 1
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
15
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
16 cd ..
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
17 hg clone test test-clone
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
18
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
19 cd test-clone
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
20 cp .hg/store/data/beta.i tmp
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
21 echo blah >> beta
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
22 hg ci -m '2 (corrupt)'
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
23 mv tmp .hg/store/data/beta.i
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
24 hg push 2>&1 | sed "s%$STRIP%test-root%"