Mercurial > hg
annotate tests/test-permissions.t @ 52176:72bc29f01570
revlog: add glue to use a pure-Rust VFS
This will save us a lot of calling back into Python, which is always
horribly expensive.
We are now faster in all benchmarked cases except for `log --patch`
specifically on mozilla-try. Fixing this will happen in a later patch.
```
### data-env-vars.name = mercurial-devel-2024-03-22-ds2-pnm
# benchmark.name = hg.command.cat
# bin-env-vars.hg.flavor = rust
# bin-env-vars.hg.py-re2-module = default
# benchmark.variants.files = all-root
# benchmark.variants.output = plain
# benchmark.variants.rev = tip
e679697a6ca4: 1.760765 ~~~~~
5559d7e63ec3: 1.555513 (-11.66%, -0.21)
### data-env-vars.name = mozilla-try-2024-03-26-ds2-pnm
# benchmark.name = hg.command.cat
# bin-env-vars.hg.flavor = rust
# bin-env-vars.hg.py-re2-module = default
# benchmark.variants.files = all-root
# benchmark.variants.output = plain
# benchmark.variants.rev = tip
e679697a6ca4: 62.848869 ~~~~~
5559d7e63ec3: 58.113051 (-7.54%, -4.74)
### data-env-vars.name = mozilla-try-2024-03-26-ds2-pnm
# benchmark.name = hg.command.log
# bin-env-vars.hg.flavor = rust
# bin-env-vars.hg.py-re2-module = default
# benchmark.variants.limit-rev = 10
# benchmark.variants.patch = yes
# benchmark.variants.rev = none
e679697a6ca4: 3.173532 ~~~~~
5559d7e63ec3: 3.543591 (+11.66%, +0.37)
### data-env-vars.name = mozilla-try-2024-03-26-ds2-pnm
# benchmark.name = hg.command.log
# bin-env-vars.hg.flavor = rust
# bin-env-vars.hg.py-re2-module = default
# benchmark.variants.limit-rev = 1000
# benchmark.variants.patch = no
# benchmark.variants.rev = none
e679697a6ca4: 1.214698 ~~~~~
5559d7e63ec3: 1.192478 (-1.83%, -0.02)
### data-env-vars.name = mozilla-unified-2024-03-22-ds2-pnm
# benchmark.name = hg.command.cat
# bin-env-vars.hg.flavor = rust
# bin-env-vars.hg.py-re2-module = default
# benchmark.variants.files = all-root
# benchmark.variants.output = plain
# benchmark.variants.rev = tip
e679697a6ca4: 56.205474 ~~~~~
5559d7e63ec3: 51.520074 (-8.34%, -4.69)
### data-env-vars.name = mozilla-unified-2024-03-22-ds2-pnm
# benchmark.name = hg.command.log
# bin-env-vars.hg.flavor = rust
# bin-env-vars.hg.py-re2-module = default
# benchmark.variants.limit-rev = 10
# benchmark.variants.patch = yes
# benchmark.variants.rev = none
e679697a6ca4: 2.105419 ~~~~~
5559d7e63ec3: 2.051849 (-2.54%, -0.05)
### data-env-vars.name = mozilla-unified-2024-03-22-ds2-pnm
# benchmark.name = hg.command.log
# bin-env-vars.hg.flavor = rust
# bin-env-vars.hg.py-re2-module = default
# benchmark.variants.limit-rev = 1000
# benchmark.variants.patch = no
# benchmark.variants.rev = none
e679697a6ca4: 0.309960 ~~~~~
5559d7e63ec3: 0.299035 (-3.52%, -0.01)
### data-env-vars.name = tryton-public-2024-03-22-ds2-pnm
# benchmark.name = hg.command.cat
# bin-env-vars.hg.flavor = rust
# bin-env-vars.hg.py-re2-module = default
# benchmark.variants.files = all-root
# benchmark.variants.output = plain
# benchmark.variants.rev = tip
e679697a6ca4: 1.849832 ~~~~~
5559d7e63ec3: 1.805076 (-2.42%, -0.04)
### data-env-vars.name = tryton-public-2024-03-22-ds2-pnm
# benchmark.name = hg.command.log
# bin-env-vars.hg.flavor = rust
# bin-env-vars.hg.py-re2-module = default
# benchmark.variants.limit-rev = 10
# benchmark.variants.patch = yes
# benchmark.variants.rev = none
e679697a6ca4: 0.289521 ~~~~~
5559d7e63ec3: 0.279889 (-3.33%, -0.01)
### data-env-vars.name = tryton-public-2024-03-22-ds2-pnm
# benchmark.name = hg.command.log
# bin-env-vars.hg.flavor = rust
# bin-env-vars.hg.py-re2-module = default
# benchmark.variants.limit-rev = 1000
# benchmark.variants.patch = no
# benchmark.variants.rev = none
e679697a6ca4: 0.332270 ~~~~~
5559d7e63ec3: 0.323324 (-2.69%, -0.01)
```
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Mon, 29 Jul 2024 20:39:34 +0200 |
parents | 7346f93be7a4 |
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 .. |