Mercurial > hg
annotate tests/test-permissions.t @ 52282:51a350a22d0c
branching: merge stable into default
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Wed, 20 Nov 2024 15:53:19 +0100 |
parents | 72bc29f01570 |
children |
rev | line source |
---|---|
37416
7542e97c7867
tests: conditionalize tests for various repo features
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33428
diff
changeset
|
1 #require unix-permissions no-root reporevlogstore |
15443
a1914d214579
tests: use 'hghave unix-permissions' for tests that really use chmod
Mads Kiilerich <mads@kiilerich.com>
parents:
12640
diff
changeset
|
2 |
48068
bf8837e3d7ce
dirstate: Remove the flat Rust DirstateMap implementation
Simon Sapin <simon.sapin@octobus.net>
parents:
47281
diff
changeset
|
3 #testcases dirstate-v1 dirstate-v2 |
47129
93eb6c8035a9
dirstate-tree: Add a dirstate-v1-tree variant of some tests
Simon Sapin <simon.sapin@octobus.net>
parents:
41420
diff
changeset
|
4 |
47281
6763913fa175
dirstate-v2: Add a variant of some tests, that uses the new format
Simon Sapin <simon.sapin@octobus.net>
parents:
47129
diff
changeset
|
5 #if dirstate-v2 |
48235
5c567aca080d
dirstate-v2: add an option to prevent unintentional slow dirstate-v2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
48223
diff
changeset
|
6 $ cat >> $HGRCPATH << EOF |
5c567aca080d
dirstate-v2: add an option to prevent unintentional slow dirstate-v2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
48223
diff
changeset
|
7 > [format] |
48674
f7086f6173f8
dirstate-v2: rename the configuration to enable the format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
48295
diff
changeset
|
8 > use-dirstate-v2=1 |
48235
5c567aca080d
dirstate-v2: add an option to prevent unintentional slow dirstate-v2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
48223
diff
changeset
|
9 > [storage] |
5c567aca080d
dirstate-v2: add an option to prevent unintentional slow dirstate-v2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
48223
diff
changeset
|
10 > dirstate-v2.slow-path=allow |
5c567aca080d
dirstate-v2: add an option to prevent unintentional slow dirstate-v2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
48223
diff
changeset
|
11 > EOF |
47281
6763913fa175
dirstate-v2: Add a variant of some tests, that uses the new format
Simon Sapin <simon.sapin@octobus.net>
parents:
47129
diff
changeset
|
12 #endif |
6763913fa175
dirstate-v2: Add a variant of some tests, that uses the new format
Simon Sapin <simon.sapin@octobus.net>
parents:
47129
diff
changeset
|
13 |
12279 | 14 $ hg init t |
15 $ cd t | |
16 | |
17 $ echo foo > a | |
18 $ hg add a | |
19 | |
20 $ hg commit -m "1" | |
21 | |
49825
2f2682f40ea0
tests: use the `--quiet` flag for verify when applicable
Raphaël Gomès <rgomes@octobus.net>
parents:
48681
diff
changeset
|
22 $ hg verify -q |
12279 | 23 |
24 $ chmod -r .hg/store/data/a.i | |
25 | |
49825
2f2682f40ea0
tests: use the `--quiet` flag for verify when applicable
Raphaël Gomès <rgomes@octobus.net>
parents:
48681
diff
changeset
|
26 $ hg verify -q |
50292
adecb1ab4a0d
tests: add a rewriting step to detect EACCES errors
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
49825
diff
changeset
|
27 abort: $EACCES$: '$TESTTMP/t/.hg/store/data/a.i' |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
28 [255] |
12279 | 29 |
30 $ chmod +r .hg/store/data/a.i | |
31 | |
49825
2f2682f40ea0
tests: use the `--quiet` flag for verify when applicable
Raphaël Gomès <rgomes@octobus.net>
parents:
48681
diff
changeset
|
32 $ hg verify -q |
1497 | 33 |
12279 | 34 $ chmod -w .hg/store/data/a.i |
35 | |
36 $ echo barber > a | |
52167
7346f93be7a4
revlog: add the glue to use the Rust `InnerRevlog` from Python
Raphaël Gomès <rgomes@octobus.net>
parents:
50292
diff
changeset
|
37 #if rust |
7346f93be7a4
revlog: add the glue to use the Rust `InnerRevlog` from Python
Raphaël Gomès <rgomes@octobus.net>
parents:
50292
diff
changeset
|
38 $ hg commit -m "2" |
52176
72bc29f01570
revlog: add glue to use a pure-Rust VFS
Raphaël Gomès <rgomes@octobus.net>
parents:
52167
diff
changeset
|
39 abort: abort: when writing $TESTTMP/t/.hg/store/data/a.i: $EACCES$ |
52167
7346f93be7a4
revlog: add the glue to use the Rust `InnerRevlog` from Python
Raphaël Gomès <rgomes@octobus.net>
parents:
50292
diff
changeset
|
40 [50] |
7346f93be7a4
revlog: add the glue to use the Rust `InnerRevlog` from Python
Raphaël Gomès <rgomes@octobus.net>
parents:
50292
diff
changeset
|
41 #else |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
42 $ hg commit -m "2" |
12279 | 43 trouble committing a! |
50292
adecb1ab4a0d
tests: add a rewriting step to detect EACCES errors
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
49825
diff
changeset
|
44 abort: $EACCES$: '$TESTTMP/t/.hg/store/data/a.i' |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
45 [255] |
52167
7346f93be7a4
revlog: add the glue to use the Rust `InnerRevlog` from Python
Raphaël Gomès <rgomes@octobus.net>
parents:
50292
diff
changeset
|
46 #endif |
12279 | 47 |
48 $ chmod -w . | |
49 | |
50 $ hg diff --nodates | |
51 diff -r 2a18120dc1c9 a | |
52 --- a/a | |
53 +++ b/a | |
54 @@ -1,1 +1,1 @@ | |
55 -foo | |
56 +barber | |
7099
6f750e76fb46
dirstate.walk: skip unreadable directories (issue1213)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5519
diff
changeset
|
57 |
12279 | 58 $ chmod +w . |
59 | |
60 $ chmod +w .hg/store/data/a.i | |
61 $ mkdir dir | |
62 $ touch dir/a | |
63 $ hg status | |
64 M a | |
65 ? dir/a | |
66 $ chmod -rx dir | |
33428
435f63d12475
tests: avoid tests related to directory permission if running with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
22047
diff
changeset
|
67 |
435f63d12475
tests: avoid tests related to directory permission if running with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
22047
diff
changeset
|
68 #if no-fsmonitor |
435f63d12475
tests: avoid tests related to directory permission if running with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
22047
diff
changeset
|
69 |
435f63d12475
tests: avoid tests related to directory permission if running with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
22047
diff
changeset
|
70 (fsmonitor makes "hg status" avoid accessing to "dir") |
435f63d12475
tests: avoid tests related to directory permission if running with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
22047
diff
changeset
|
71 |
12279 | 72 $ hg status |
50292
adecb1ab4a0d
tests: add a rewriting step to detect EACCES errors
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
49825
diff
changeset
|
73 dir: $EACCES$* (glob) |
12279 | 74 M a |
75 | |
33428
435f63d12475
tests: avoid tests related to directory permission if running with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
22047
diff
changeset
|
76 #endif |
435f63d12475
tests: avoid tests related to directory permission if running with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
22047
diff
changeset
|
77 |
12279 | 78 Reenable perm to allow deletion: |
79 | |
80 $ chmod +rx dir | |
81 | |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
15443
diff
changeset
|
82 $ cd .. |