annotate tests/test-audit-path.t @ 12269:877236cdd437

add: move main part to cmdutil to make it easier to reuse
author Martin Geisler <mg@lazybytes.net>
date Mon, 13 Sep 2010 13:09:11 +0200
parents 054b0d9c3f0c
children 4134686b83e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
1 $ hg init
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
2
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
3 should fail
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
4
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
5 $ hg add .hg/00changelog.i
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
6 abort: path contains illegal component: .hg/00changelog.i
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
7
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
8 $ mkdir a
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
9 $ echo a > a/a
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
10 $ hg ci -Ama
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
11 adding a/a
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
12 $ ln -s a b
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
13 $ echo b > a/b
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
14
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
15 should fail
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
16
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
17 $ hg add b/b
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
18 abort: path 'b/b' traverses symbolic link 'b'
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
19
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
20 should succeed
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
21
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
22 $ hg add b
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
23
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
24 should still fail - maybe
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
25
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
26 $ hg add b/b
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
27 abort: path 'b/b' traverses symbolic link 'b'
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
28
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
29 unbundle tampered bundle
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
30
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
31 $ hg init target
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
32 $ cd target
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
33 $ hg unbundle $TESTDIR/tampered.hg
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
34 adding changesets
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
35 adding manifests
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
36 adding file changes
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
37 added 5 changesets with 6 changes to 6 files (+4 heads)
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
38 (run 'hg heads' to see heads, 'hg merge' to merge)
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
39
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
40 attack .hg/test
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
41
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
42 $ hg manifest -r0
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
43 .hg/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
44 $ hg update -Cr0
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
45 abort: path contains illegal component: .hg/test
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
46
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
47 attack foo/.hg/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
48
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
49 $ hg manifest -r1
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
50 foo/.hg/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
51 $ hg update -Cr1
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
52 abort: path 'foo/.hg/test' is inside repo 'foo'
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
53
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
54 attack back/test where back symlinks to ..
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
55
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
56 $ hg manifest -r2
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
57 back
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
58 back/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
59 $ hg update -Cr2
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
60 abort: path 'back/test' traverses symbolic link 'back'
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
61
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
62 attack ../test
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
63
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
64 $ hg manifest -r3
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
65 ../test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
66 $ hg update -Cr3
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
67 abort: path contains illegal component: ../test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
68
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
69 attack /tmp/test
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
70
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
71 $ hg manifest -r4
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
72 /tmp/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
73 $ hg update -Cr4
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
74 abort: No such file or directory: .*/test-audit-path.t/target//tmp/test
7586
e9d3a11eacad test-audit-path: add one more test (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 7554
diff changeset
75
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
76 $ exit 0