Show More
@@ -1,17 +1,15 b'' | |||
|
1 |
# |
|
|
1 | #require test-repo | |
|
2 | 2 | |
|
3 | 3 | $ check_code="$TESTDIR"/../contrib/check-code.py |
|
4 | 4 | $ cd "$TESTDIR"/.. |
|
5 | 5 | |
|
6 | 6 | New errors are not allowed. Warnings are strongly discouraged. |
|
7 | 7 | (The writing "no-che?k-code" is for not skipping this file when checking.) |
|
8 | 8 | |
|
9 | 9 | $ hg locate | sed 's-\\-/-g' | |
|
10 | 10 | > xargs "$check_code" --warnings --per-file=0 || false |
|
11 | 11 | Skipping hgext/zeroconf/Zeroconf.py it has no-che?k-code (glob) |
|
12 | 12 | Skipping i18n/polib.py it has no-che?k-code (glob) |
|
13 | 13 | Skipping mercurial/httpclient/__init__.py it has no-che?k-code (glob) |
|
14 | 14 | Skipping mercurial/httpclient/_readers.py it has no-che?k-code (glob) |
|
15 | 15 | Skipping mercurial/httpclient/socketutil.py it has no-che?k-code (glob) |
|
16 | ||
|
17 | #endif |
@@ -1,22 +1,20 b'' | |||
|
1 |
# |
|
|
1 | #require test-repo pyflakes | |
|
2 | 2 | |
|
3 | 3 | $ cd "`dirname "$TESTDIR"`" |
|
4 | 4 | |
|
5 | 5 | run pyflakes on all tracked files ending in .py or without a file ending |
|
6 | 6 | (skipping binary file random-seed) |
|
7 | 7 | |
|
8 | 8 | $ hg locate 'set:**.py or grep("^!#.*python")' 2>/dev/null \ |
|
9 | 9 | > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py" |
|
10 | 10 | contrib/win32/hgwebdir_wsgi.py:*: 'win32traceutil' imported but unused (glob) |
|
11 | 11 | setup.py:*: 'sha' imported but unused (glob) |
|
12 | 12 | setup.py:*: 'zlib' imported but unused (glob) |
|
13 | 13 | setup.py:*: 'bz2' imported but unused (glob) |
|
14 | 14 | setup.py:*: 'py2exe' imported but unused (glob) |
|
15 | 15 | tests/hghave.py:*: '_lsprof' imported but unused (glob) |
|
16 | 16 | tests/hghave.py:*: 'publish_cmdline' imported but unused (glob) |
|
17 | 17 | tests/hghave.py:*: 'pygments' imported but unused (glob) |
|
18 | 18 | tests/hghave.py:*: 'ssl' imported but unused (glob) |
|
19 | 19 | contrib/win32/hgwebdir_wsgi.py:93: 'from isapi.install import *' used; unable to detect undefined names (glob) |
|
20 | 20 | tests/filterpyflakes.py:58: undefined name 'undefinedname' |
|
21 | ||
|
22 | #endif |
@@ -1,42 +1,41 b'' | |||
|
1 |
# |
|
|
1 | #require unix-permissions no-root no-windows | |
|
2 | 2 | |
|
3 | 3 | Prepare |
|
4 | 4 | |
|
5 | 5 | $ hg init a |
|
6 | 6 | $ echo a > a/a |
|
7 | 7 | $ hg -R a ci -A -m a |
|
8 | 8 | adding a |
|
9 | 9 | |
|
10 | 10 | $ hg clone a b |
|
11 | 11 | updating to branch default |
|
12 | 12 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
13 | 13 | |
|
14 | 14 | One process waiting for another |
|
15 | 15 | |
|
16 | 16 | $ cat > hooks.py << EOF |
|
17 | 17 | > import time |
|
18 | 18 | > def sleepone(**x): time.sleep(1) |
|
19 | 19 | > def sleephalf(**x): time.sleep(0.5) |
|
20 | 20 | > EOF |
|
21 | 21 | $ echo b > b/b |
|
22 | 22 | $ hg -R b ci -A -m b --config hooks.precommit="python:`pwd`/hooks.py:sleepone" > stdout & |
|
23 | 23 | $ hg -R b up -q --config hooks.pre-update="python:`pwd`/hooks.py:sleephalf" |
|
24 | 24 | waiting for lock on working directory of b held by '*:*' (glob) |
|
25 | 25 | got lock after ? seconds (glob) |
|
26 | 26 | warning: ignoring unknown working parent d2ae7f538514! |
|
27 | 27 | $ wait |
|
28 | 28 | $ cat stdout |
|
29 | 29 | adding b |
|
30 | 30 | |
|
31 | 31 | Pushing to a local read-only repo that can't be locked |
|
32 | 32 | |
|
33 | 33 | $ chmod 100 a/.hg/store |
|
34 | 34 | |
|
35 | 35 | $ hg -R b push a |
|
36 | 36 | pushing to a |
|
37 | 37 | searching for changes |
|
38 | 38 | abort: could not lock repository a: Permission denied |
|
39 | 39 | [255] |
|
40 | 40 | |
|
41 | 41 | $ chmod 700 a/.hg/store |
|
42 | #endif |
@@ -1,74 +1,72 b'' | |||
|
1 |
# |
|
|
1 | #require unix-permissions no-root | |
|
2 | 2 | |
|
3 | 3 | $ hg init t |
|
4 | 4 | $ cd t |
|
5 | 5 | |
|
6 | 6 | $ echo foo > a |
|
7 | 7 | $ hg add a |
|
8 | 8 | |
|
9 | 9 | $ hg commit -m "1" |
|
10 | 10 | |
|
11 | 11 | $ hg verify |
|
12 | 12 | checking changesets |
|
13 | 13 | checking manifests |
|
14 | 14 | crosschecking files in changesets and manifests |
|
15 | 15 | checking files |
|
16 | 16 | 1 files, 1 changesets, 1 total revisions |
|
17 | 17 | |
|
18 | 18 | $ chmod -r .hg/store/data/a.i |
|
19 | 19 | |
|
20 | 20 | $ hg verify |
|
21 | 21 | checking changesets |
|
22 | 22 | checking manifests |
|
23 | 23 | crosschecking files in changesets and manifests |
|
24 | 24 | checking files |
|
25 | 25 | abort: Permission denied: $TESTTMP/t/.hg/store/data/a.i |
|
26 | 26 | [255] |
|
27 | 27 | |
|
28 | 28 | $ chmod +r .hg/store/data/a.i |
|
29 | 29 | |
|
30 | 30 | $ hg verify |
|
31 | 31 | checking changesets |
|
32 | 32 | checking manifests |
|
33 | 33 | crosschecking files in changesets and manifests |
|
34 | 34 | checking files |
|
35 | 35 | 1 files, 1 changesets, 1 total revisions |
|
36 | 36 | |
|
37 | 37 | $ chmod -w .hg/store/data/a.i |
|
38 | 38 | |
|
39 | 39 | $ echo barber > a |
|
40 | 40 | $ hg commit -m "2" |
|
41 | 41 | trouble committing a! |
|
42 | 42 | abort: Permission denied: $TESTTMP/t/.hg/store/data/a.i |
|
43 | 43 | [255] |
|
44 | 44 | |
|
45 | 45 | $ chmod -w . |
|
46 | 46 | |
|
47 | 47 | $ hg diff --nodates |
|
48 | 48 | diff -r 2a18120dc1c9 a |
|
49 | 49 | --- a/a |
|
50 | 50 | +++ b/a |
|
51 | 51 | @@ -1,1 +1,1 @@ |
|
52 | 52 | -foo |
|
53 | 53 | +barber |
|
54 | 54 | |
|
55 | 55 | $ chmod +w . |
|
56 | 56 | |
|
57 | 57 | $ chmod +w .hg/store/data/a.i |
|
58 | 58 | $ mkdir dir |
|
59 | 59 | $ touch dir/a |
|
60 | 60 | $ hg status |
|
61 | 61 | M a |
|
62 | 62 | ? dir/a |
|
63 | 63 | $ chmod -rx dir |
|
64 | 64 | $ hg status |
|
65 | 65 | dir: Permission denied |
|
66 | 66 | M a |
|
67 | 67 | |
|
68 | 68 | Reenable perm to allow deletion: |
|
69 | 69 | |
|
70 | 70 | $ chmod +rx dir |
|
71 | 71 | |
|
72 | 72 | $ cd .. |
|
73 | ||
|
74 | #endif |
@@ -1,34 +1,32 b'' | |||
|
1 |
# |
|
|
1 | #require unix-permissions no-root | |
|
2 | 2 | |
|
3 | 3 | $ hg init a |
|
4 | 4 | $ cd a |
|
5 | 5 | $ echo foo > b |
|
6 | 6 | $ hg add b |
|
7 | 7 | $ hg ci -m "b" |
|
8 | 8 | |
|
9 | 9 | $ chmod -w .hg/store |
|
10 | 10 | |
|
11 | 11 | $ cd .. |
|
12 | 12 | |
|
13 | 13 | $ hg clone a b |
|
14 | 14 | requesting all changes |
|
15 | 15 | adding changesets |
|
16 | 16 | adding manifests |
|
17 | 17 | adding file changes |
|
18 | 18 | added 1 changesets with 1 changes to 1 files |
|
19 | 19 | updating to branch default |
|
20 | 20 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
21 | 21 | |
|
22 | 22 | $ chmod +w a/.hg/store # let test clean up |
|
23 | 23 | |
|
24 | 24 | $ cd b |
|
25 | 25 | $ hg verify |
|
26 | 26 | checking changesets |
|
27 | 27 | checking manifests |
|
28 | 28 | crosschecking files in changesets and manifests |
|
29 | 29 | checking files |
|
30 | 30 | 1 files, 1 changesets, 1 total revisions |
|
31 | 31 | |
|
32 | 32 | $ cd .. |
|
33 | ||
|
34 | #endif |
@@ -1,134 +1,132 b'' | |||
|
1 |
# |
|
|
1 | #require unix-permissions no-root | |
|
2 | 2 | |
|
3 | 3 | $ echo "[extensions]" >> $HGRCPATH |
|
4 | 4 | $ echo "mq=">> $HGRCPATH |
|
5 | 5 | |
|
6 | 6 | $ teststrip() { |
|
7 | 7 | > hg -q up -C $1 |
|
8 | 8 | > echo % before update $1, strip $2 |
|
9 | 9 | > hg parents |
|
10 | 10 | > chmod -$3 $4 |
|
11 | 11 | > hg strip $2 2>&1 | sed 's/\(bundle\).*/\1/' | sed 's/Permission denied.*\.hg\/store\/\(.*\)/Permission denied \.hg\/store\/\1/' |
|
12 | 12 | > echo % after update $1, strip $2 |
|
13 | 13 | > chmod +$3 $4 |
|
14 | 14 | > hg verify |
|
15 | 15 | > echo % journal contents |
|
16 | 16 | > if [ -f .hg/store/journal ]; then |
|
17 | 17 | > sed -e 's/\.i[^\n]*/\.i/' .hg/store/journal |
|
18 | 18 | > else |
|
19 | 19 | > echo "(no journal)" |
|
20 | 20 | > fi |
|
21 | 21 | > ls .hg/store/journal >/dev/null 2>&1 && hg recover |
|
22 | 22 | > ls .hg/strip-backup/* >/dev/null 2>&1 && hg unbundle -q .hg/strip-backup/* |
|
23 | 23 | > rm -rf .hg/strip-backup |
|
24 | 24 | > } |
|
25 | 25 | |
|
26 | 26 | $ hg init test |
|
27 | 27 | $ cd test |
|
28 | 28 | $ echo a > a |
|
29 | 29 | $ hg -q ci -m "a" -A |
|
30 | 30 | $ echo b > b |
|
31 | 31 | $ hg -q ci -m "b" -A |
|
32 | 32 | $ echo b2 >> b |
|
33 | 33 | $ hg -q ci -m "b2" -A |
|
34 | 34 | $ echo c > c |
|
35 | 35 | $ hg -q ci -m "c" -A |
|
36 | 36 | $ teststrip 0 2 w .hg/store/data/b.i |
|
37 | 37 | % before update 0, strip 2 |
|
38 | 38 | changeset: 0:cb9a9f314b8b |
|
39 | 39 | user: test |
|
40 | 40 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
41 | 41 | summary: a |
|
42 | 42 | |
|
43 | 43 | saved backup bundle |
|
44 | 44 | transaction abort! |
|
45 | 45 | failed to truncate data/b.i |
|
46 | 46 | rollback failed - please run hg recover |
|
47 | 47 | strip failed, full bundle |
|
48 | 48 | abort: Permission denied .hg/store/data/b.i |
|
49 | 49 | % after update 0, strip 2 |
|
50 | 50 | abandoned transaction found - run hg recover |
|
51 | 51 | checking changesets |
|
52 | 52 | checking manifests |
|
53 | 53 | crosschecking files in changesets and manifests |
|
54 | 54 | checking files |
|
55 | 55 | b@?: rev 1 points to nonexistent changeset 2 |
|
56 | 56 | (expected 1) |
|
57 | 57 | b@?: 736c29771fba not in manifests |
|
58 | 58 | warning: orphan revlog 'data/c.i' |
|
59 | 59 | 2 files, 2 changesets, 3 total revisions |
|
60 | 60 | 2 warnings encountered! |
|
61 | 61 | 2 integrity errors encountered! |
|
62 | 62 | % journal contents |
|
63 | 63 | 00changelog.i |
|
64 | 64 | 00manifest.i |
|
65 | 65 | data/b.i |
|
66 | 66 | data/c.i |
|
67 | 67 | rolling back interrupted transaction |
|
68 | 68 | checking changesets |
|
69 | 69 | checking manifests |
|
70 | 70 | crosschecking files in changesets and manifests |
|
71 | 71 | checking files |
|
72 | 72 | 2 files, 2 changesets, 2 total revisions |
|
73 | 73 | $ teststrip 0 2 r .hg/store/data/b.i |
|
74 | 74 | % before update 0, strip 2 |
|
75 | 75 | changeset: 0:cb9a9f314b8b |
|
76 | 76 | user: test |
|
77 | 77 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
78 | 78 | summary: a |
|
79 | 79 | |
|
80 | 80 | abort: Permission denied .hg/store/data/b.i |
|
81 | 81 | % after update 0, strip 2 |
|
82 | 82 | checking changesets |
|
83 | 83 | checking manifests |
|
84 | 84 | crosschecking files in changesets and manifests |
|
85 | 85 | checking files |
|
86 | 86 | 3 files, 4 changesets, 4 total revisions |
|
87 | 87 | % journal contents |
|
88 | 88 | (no journal) |
|
89 | 89 | $ teststrip 0 2 w .hg/store/00manifest.i |
|
90 | 90 | % before update 0, strip 2 |
|
91 | 91 | changeset: 0:cb9a9f314b8b |
|
92 | 92 | user: test |
|
93 | 93 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
94 | 94 | summary: a |
|
95 | 95 | |
|
96 | 96 | saved backup bundle |
|
97 | 97 | transaction abort! |
|
98 | 98 | failed to truncate 00manifest.i |
|
99 | 99 | rollback failed - please run hg recover |
|
100 | 100 | strip failed, full bundle |
|
101 | 101 | abort: Permission denied .hg/store/00manifest.i |
|
102 | 102 | % after update 0, strip 2 |
|
103 | 103 | abandoned transaction found - run hg recover |
|
104 | 104 | checking changesets |
|
105 | 105 | checking manifests |
|
106 | 106 | manifest@?: rev 2 points to nonexistent changeset 2 |
|
107 | 107 | manifest@?: 3362547cdf64 not in changesets |
|
108 | 108 | manifest@?: rev 3 points to nonexistent changeset 3 |
|
109 | 109 | manifest@?: 265a85892ecb not in changesets |
|
110 | 110 | crosschecking files in changesets and manifests |
|
111 | 111 | c@3: in manifest but not in changeset |
|
112 | 112 | checking files |
|
113 | 113 | b@?: rev 1 points to nonexistent changeset 2 |
|
114 | 114 | (expected 1) |
|
115 | 115 | c@?: rev 0 points to nonexistent changeset 3 |
|
116 | 116 | 3 files, 2 changesets, 4 total revisions |
|
117 | 117 | 1 warnings encountered! |
|
118 | 118 | 7 integrity errors encountered! |
|
119 | 119 | (first damaged changeset appears to be 3) |
|
120 | 120 | % journal contents |
|
121 | 121 | 00changelog.i |
|
122 | 122 | 00manifest.i |
|
123 | 123 | data/b.i |
|
124 | 124 | data/c.i |
|
125 | 125 | rolling back interrupted transaction |
|
126 | 126 | checking changesets |
|
127 | 127 | checking manifests |
|
128 | 128 | crosschecking files in changesets and manifests |
|
129 | 129 | checking files |
|
130 | 130 | 2 files, 2 changesets, 2 total revisions |
|
131 | 131 | |
|
132 | 132 | $ cd .. |
|
133 | ||
|
134 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now