Mercurial > public > mercurial-scm > hg-stable
annotate tests/test-audit-path.t @ 53040:cdd7bf612c7b stable tip
bundle-spec: properly format boolean parameter (issue6960)
This was breaking automatic clone bundle generation. This changeset fixes it and
add a test to catch it in the future.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 11 Mar 2025 02:29:42 +0100 |
parents | 4d2b496cb7b8 |
children |
rev | line source |
---|---|
37421
9984488550ea
tests: disable test-audit-path.t with simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37104
diff
changeset
|
1 The simple store doesn't escape paths robustly and can't store paths |
9984488550ea
tests: disable test-audit-path.t with simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37104
diff
changeset
|
2 with periods, etc. So much of this test fails with it. |
9984488550ea
tests: disable test-audit-path.t with simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37104
diff
changeset
|
3 |
49585
55c6ebd11cb9
tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
48417
diff
changeset
|
4 $ hg init repo |
55c6ebd11cb9
tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
48417
diff
changeset
|
5 $ cd repo |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
6 |
16908
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
7 audit of .hg |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
8 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
9 $ hg add .hg/00changelog.i |
35400
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
34942
diff
changeset
|
10 abort: path contains illegal component: .hg/00changelog.i |
48417
35f1ecd84bd0
errors: use detailed exit code in pathauditor
Martin von Zweigbergk <martinvonz@google.com>
parents:
45794
diff
changeset
|
11 [10] |
5158
d316124ebbea
Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
12 |
16908
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
13 #if symlink |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
14 |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
15 Symlinks |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
16 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
17 $ mkdir a |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
18 $ echo a > a/a |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
19 $ hg ci -Ama |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
20 adding a/a |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
21 $ ln -s a b |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
22 $ echo b > a/b |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
23 $ hg add b/b |
35400
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
34942
diff
changeset
|
24 abort: path 'b/b' traverses symbolic link 'b' |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11855
diff
changeset
|
25 [255] |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
26 $ hg add b |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
27 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
28 should still fail - maybe |
5158
d316124ebbea
Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
29 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
30 $ hg add b/b |
35400
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
34942
diff
changeset
|
31 abort: path 'b/b' traverses symbolic link 'b' |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11855
diff
changeset
|
32 [255] |
5158
d316124ebbea
Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
33 |
27234
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
34 $ hg commit -m 'add symlink b' |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
35 |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
36 |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
37 Test symlink traversing when accessing history: |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
38 ----------------------------------------------- |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
39 |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
40 (build a changeset where the path exists as a directory) |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
41 |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
42 $ hg up 0 |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
43 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
44 $ mkdir b |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
45 $ echo c > b/a |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
46 $ hg add b/a |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
47 $ hg ci -m 'add directory b' |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
48 created new head |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
49 |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
50 Test that hg cat does not do anything wrong the working copy has 'b' as directory |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
51 |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
52 $ hg cat b/a |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
53 c |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
54 $ hg cat -r "desc(directory)" b/a |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
55 c |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
56 $ hg cat -r "desc(symlink)" b/a |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
57 b/a: no such file in rev bc151a1f53bd |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
58 [1] |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
59 |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
60 Test that hg cat does not do anything wrong the working copy has 'b' as a symlink (issue4749) |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
61 |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
62 $ hg up 'desc(symlink)' |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
63 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
64 $ hg cat b/a |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
65 b/a: no such file in rev bc151a1f53bd |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
66 [1] |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
67 $ hg cat -r "desc(directory)" b/a |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
68 c |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
69 $ hg cat -r "desc(symlink)" b/a |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
70 b/a: no such file in rev bc151a1f53bd |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
71 [1] |
15c6eb0a51bd
context: use a the nofsauditor when matching file in history (issue4749)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
18506
diff
changeset
|
72 |
16908
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
73 #endif |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
74 |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
75 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
76 unbundle tampered bundle |
5158
d316124ebbea
Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
77 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
78 $ hg init target |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
79 $ cd target |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15521
diff
changeset
|
80 $ hg unbundle "$TESTDIR/bundles/tampered.hg" |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
81 adding changesets |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
82 adding manifests |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
83 adding file changes |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
84 added 5 changesets with 6 changes to 6 files (+4 heads) |
39497
89630d0b3e23
phase: report number of non-public changeset alongside the new range
Boris Feld <boris.feld@octobus.net>
parents:
37421
diff
changeset
|
85 new changesets b7da9bf6b037:fc1393d727bc (5 drafts) |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
86 (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
|
87 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
88 attack .hg/test |
7554
11a4eb81fb4f
test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
5158
diff
changeset
|
89 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
90 $ hg manifest -r0 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
91 .hg/test |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
92 $ hg update -Cr0 |
52084
8b7123c8947b
update: add a Rust fast-path when updating from null (and clean)
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51979
diff
changeset
|
93 abort: path contains illegal component: .hg/test (no-rust !) |
8b7123c8947b
update: add a Rust fast-path when updating from null (and clean)
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51979
diff
changeset
|
94 abort: path '.hg/test' is inside the '.hg' folder (rust !) |
48417
35f1ecd84bd0
errors: use detailed exit code in pathauditor
Martin von Zweigbergk <martinvonz@google.com>
parents:
45794
diff
changeset
|
95 [10] |
7554
11a4eb81fb4f
test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
5158
diff
changeset
|
96 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
97 attack foo/.hg/test |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
98 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
99 $ hg manifest -r1 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
100 foo/.hg/test |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
101 $ hg update -Cr1 |
35400
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
34942
diff
changeset
|
102 abort: path 'foo/.hg/test' is inside nested repo 'foo' |
48417
35f1ecd84bd0
errors: use detailed exit code in pathauditor
Martin von Zweigbergk <martinvonz@google.com>
parents:
45794
diff
changeset
|
103 [10] |
7554
11a4eb81fb4f
test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
5158
diff
changeset
|
104 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
105 attack back/test where back symlinks to .. |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
106 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
107 $ hg manifest -r2 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
108 back |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
109 back/test |
52084
8b7123c8947b
update: add a Rust fast-path when updating from null (and clean)
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51979
diff
changeset
|
110 |
16908
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
111 #if symlink |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
112 $ hg update -Cr2 |
34942
2a774cae3a03
merge: disable path conflict checking by default (issue5716)
Siddharth Agarwal <sid0@fb.com>
parents:
34833
diff
changeset
|
113 abort: path 'back/test' traverses symbolic link 'back' |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11855
diff
changeset
|
114 [255] |
16908
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
115 #else |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
116 ('back' will be a file and cause some other system specific error) |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
117 $ hg update -Cr2 |
51979
9b14a8cf4f78
tests: correct Windows output to account for putting repos in `repo` subdir
Matt Harbison <matt_harbison@yahoo.com>
parents:
49585
diff
changeset
|
118 abort: $TESTTMP/repo/target/back/test: $ENOTDIR$ |
16908
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
119 [255] |
6a997aacba5d
tests: convert some 'hghave symlink' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
120 #endif |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
121 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
122 attack ../test |
7554
11a4eb81fb4f
test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
5158
diff
changeset
|
123 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
124 $ hg manifest -r3 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
125 ../test |
34832
d6009d1488e8
tests: add test demonstrating regression in path audit
Mark Thomas <mbthomas@fb.com>
parents:
34689
diff
changeset
|
126 $ mkdir ../test |
d6009d1488e8
tests: add test demonstrating regression in path audit
Mark Thomas <mbthomas@fb.com>
parents:
34689
diff
changeset
|
127 $ echo data > ../test/file |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
128 $ hg update -Cr3 |
35400
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
34942
diff
changeset
|
129 abort: path contains illegal component: ../test |
48417
35f1ecd84bd0
errors: use detailed exit code in pathauditor
Martin von Zweigbergk <martinvonz@google.com>
parents:
45794
diff
changeset
|
130 [10] |
34832
d6009d1488e8
tests: add test demonstrating regression in path audit
Mark Thomas <mbthomas@fb.com>
parents:
34689
diff
changeset
|
131 $ cat ../test/file |
34833
07bbb208a924
context: audit paths before clearing unknown files and dirs
Mark Thomas <mbthomas@fb.com>
parents:
34832
diff
changeset
|
132 data |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
133 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
134 attack /tmp/test |
7554
11a4eb81fb4f
test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
5158
diff
changeset
|
135 |
11855
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
136 $ hg manifest -r4 |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
137 /tmp/test |
054b0d9c3f0c
tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents:
7681
diff
changeset
|
138 $ hg update -Cr4 |
35400
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
34942
diff
changeset
|
139 abort: path contains illegal component: /tmp/test |
48417
35f1ecd84bd0
errors: use detailed exit code in pathauditor
Martin von Zweigbergk <martinvonz@google.com>
parents:
45794
diff
changeset
|
140 [10] |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16908
diff
changeset
|
141 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16908
diff
changeset
|
142 $ cd .. |
33630
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
143 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
144 Test symlink traversal on merge: |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
145 -------------------------------- |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
146 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
147 #if symlink |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
148 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
149 set up symlink hell |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
150 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
151 $ mkdir merge-symlink-out |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
152 $ hg init merge-symlink |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
153 $ cd merge-symlink |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
154 $ touch base |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
155 $ hg commit -qAm base |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
156 $ ln -s ../merge-symlink-out a |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
157 $ hg commit -qAm 'symlink a -> ../merge-symlink-out' |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
158 $ hg up -q 0 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
159 $ mkdir a |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
160 $ touch a/poisoned |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
161 $ hg commit -qAm 'file a/poisoned' |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
162 $ hg log -G -T '{rev}: {desc}\n' |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
163 @ 2: file a/poisoned |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
164 | |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
165 | o 1: symlink a -> ../merge-symlink-out |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
166 |/ |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
167 o 0: base |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
168 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
169 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
170 try trivial merge |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
171 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
172 $ hg up -qC 1 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
173 $ hg merge 2 |
34942
2a774cae3a03
merge: disable path conflict checking by default (issue5716)
Siddharth Agarwal <sid0@fb.com>
parents:
34833
diff
changeset
|
174 abort: path 'a/poisoned' traverses symbolic link 'a' |
2a774cae3a03
merge: disable path conflict checking by default (issue5716)
Siddharth Agarwal <sid0@fb.com>
parents:
34833
diff
changeset
|
175 [255] |
33630
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
176 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
177 try rebase onto other revision: cache of audited paths should be discarded, |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
178 and the rebase should fail (issue5628) |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
179 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
180 $ hg up -qC 2 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
181 $ hg rebase -s 2 -d 1 --config extensions.rebase= |
45794
f90a5c211251
rebase: change and standarize template for rebase's one-line summary
Martin von Zweigbergk <martinvonz@google.com>
parents:
39497
diff
changeset
|
182 rebasing 2:e73c21d6b244 tip "file a/poisoned" |
34942
2a774cae3a03
merge: disable path conflict checking by default (issue5716)
Siddharth Agarwal <sid0@fb.com>
parents:
34833
diff
changeset
|
183 abort: path 'a/poisoned' traverses symbolic link 'a' |
2a774cae3a03
merge: disable path conflict checking by default (issue5716)
Siddharth Agarwal <sid0@fb.com>
parents:
34833
diff
changeset
|
184 [255] |
33630
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
185 $ ls ../merge-symlink-out |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
186 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
187 $ cd .. |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
188 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
189 Test symlink traversal on update: |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
190 --------------------------------- |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
191 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
192 $ mkdir update-symlink-out |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
193 $ hg init update-symlink |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
194 $ cd update-symlink |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
195 $ ln -s ../update-symlink-out a |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
196 $ hg commit -qAm 'symlink a -> ../update-symlink-out' |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
197 $ hg rm a |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
198 $ mkdir a && touch a/b |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
199 $ hg ci -qAm 'file a/b' a/b |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
200 $ hg up -qC 0 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
201 $ hg rm a |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
202 $ mkdir a && touch a/c |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
203 $ hg ci -qAm 'rm a, file a/c' |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
204 $ hg log -G -T '{rev}: {desc}\n' |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
205 @ 2: rm a, file a/c |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
206 | |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
207 | o 1: file a/b |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
208 |/ |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
209 o 0: symlink a -> ../update-symlink-out |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
210 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
211 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
212 try linear update where symlink already exists: |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
213 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
214 $ hg up -qC 0 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
215 $ hg up 1 |
34942
2a774cae3a03
merge: disable path conflict checking by default (issue5716)
Siddharth Agarwal <sid0@fb.com>
parents:
34833
diff
changeset
|
216 abort: path 'a/b' traverses symbolic link 'a' |
33630
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
217 [255] |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
218 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
219 try linear update including symlinked directory and its content: paths are |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
220 audited first by calculateupdates(), where no symlink is created so both |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
221 'a' and 'a/b' are taken as good paths. still applyupdates() should fail. |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
222 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
223 $ hg up -qC null |
52084
8b7123c8947b
update: add a Rust fast-path when updating from null (and clean)
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51979
diff
changeset
|
224 #if rust |
8b7123c8947b
update: add a Rust fast-path when updating from null (and clean)
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51979
diff
changeset
|
225 $ hg up 1 |
52124
d12dc9139135
test: stabilize `test-audit-path.t` in rust (hopefully)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
52084
diff
changeset
|
226 abort: path 'a/?' traverses symbolic link 'a' (glob) |
52084
8b7123c8947b
update: add a Rust fast-path when updating from null (and clean)
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51979
diff
changeset
|
227 [10] |
8b7123c8947b
update: add a Rust fast-path when updating from null (and clean)
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51979
diff
changeset
|
228 #endif |
8b7123c8947b
update: add a Rust fast-path when updating from null (and clean)
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51979
diff
changeset
|
229 |
8b7123c8947b
update: add a Rust fast-path when updating from null (and clean)
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51979
diff
changeset
|
230 #if no-rust |
33630
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
231 $ hg up 1 |
34942
2a774cae3a03
merge: disable path conflict checking by default (issue5716)
Siddharth Agarwal <sid0@fb.com>
parents:
34833
diff
changeset
|
232 abort: path 'a/b' traverses symbolic link 'a' |
33631
20bac46f7744
pathauditor: disable cache of audited paths by default (issue5628)
Yuya Nishihara <yuya@tcha.org>
parents:
33630
diff
changeset
|
233 [255] |
52084
8b7123c8947b
update: add a Rust fast-path when updating from null (and clean)
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51979
diff
changeset
|
234 #endif |
33630
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
235 $ ls ../update-symlink-out |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
236 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
237 try branch update replacing directory with symlink, and its content: the |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
238 path 'a' is audited as a directory first, which should be audited again as |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
239 a symlink. |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
240 |
52084
8b7123c8947b
update: add a Rust fast-path when updating from null (and clean)
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51979
diff
changeset
|
241 $ rm -rf a |
33630
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
242 $ hg up -qC 2 |
52084
8b7123c8947b
update: add a Rust fast-path when updating from null (and clean)
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51979
diff
changeset
|
243 |
33630
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
244 $ hg up 1 |
52124
d12dc9139135
test: stabilize `test-audit-path.t` in rust (hopefully)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
52084
diff
changeset
|
245 abort: path 'a/?' traverses symbolic link 'a' (glob) |
33631
20bac46f7744
pathauditor: disable cache of audited paths by default (issue5628)
Yuya Nishihara <yuya@tcha.org>
parents:
33630
diff
changeset
|
246 [255] |
33630
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
247 $ ls ../update-symlink-out |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
248 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
249 $ cd .. |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
250 |
0134d839444b
tests: show cache of audited paths is never invalidated
Yuya Nishihara <yuya@tcha.org>
parents:
27234
diff
changeset
|
251 #endif |