Mercurial > evolve
annotate tests/test-sqlite3-permissions.t @ 5917:94aed9c7ce69 stable
next: refactor two if blocks into an if-elif block
We already checked the value of `needevolve and opts['evolve']` in the first if
block above. In the first one it need to be True, in the second it needs to be
False for the statements to execute. Since not(a or b) = not a and not b, we
can join the second if block to the first one with an elif while dropping the
explicit check.
For me, this works better, because we're doing the same thing in both of these
blocks (checking if working copy is dirty or not).
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sat, 15 May 2021 20:40:19 +0800 |
parents | 2570d2d4a268 |
children |
rev | line source |
---|---|
5284
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
1 #require unix-permissions |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
2 |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
3 Test that sqlite3 cache files inherit the permissions of the .hg |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
4 directory like other cache files. |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
5 |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
6 $ . $TESTDIR/testlib/common.sh |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
7 |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
8 $ cat << EOF >> $HGRCPATH |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
9 > [extensions] |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
10 > evolve = |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
11 > EOF |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
12 $ hg init test |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
13 $ cd test |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
14 $ chmod 700 .hg |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
15 $ hg debugupdatecache |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
16 $ ls -l .hg/cache/evoext_*.sqlite |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
17 -rw------- * .hg/cache/evoext_obshashrange_v2.sqlite (glob) |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
18 -rw------- * .hg/cache/evoext_stablerange_v2.sqlite (glob) |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
19 $ rm -r .hg/cache |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
20 $ chmod 770 .hg |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
21 $ hg debugupdatecache |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
22 $ ls -l .hg/cache/evoext_*.sqlite |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
23 -rw-rw---- * .hg/cache/evoext_obshashrange_v2.sqlite (glob) |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
24 -rw-rw---- * .hg/cache/evoext_stablerange_v2.sqlite (glob) |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
25 $ rm -r .hg/cache |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
26 $ chmod 774 .hg |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
27 $ hg debugupdatecache |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
28 $ ls -l .hg/cache/evoext_*.sqlite |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
29 -rw-rw-r-- * .hg/cache/evoext_obshashrange_v2.sqlite (glob) |
2570d2d4a268
caches: preserve permissions of top-level .hg
Joerg Sonnenberger <joerg@bec.de>
parents:
diff
changeset
|
30 -rw-rw-r-- * .hg/cache/evoext_stablerange_v2.sqlite (glob) |