Mercurial > hg
comparison tests/test-clone-failure.t @ 12411:5d3c28a339cb
tests: unify test-clone-failure
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 26 Sep 2010 13:41:17 -0500 |
parents | tests/test-clone-failure@567648eab1dd |
children | bdb73eede5fb |
comparison
equal
deleted
inserted
replaced
12410:2bfb335c7594 | 12411:5d3c28a339cb |
---|---|
1 No local source | |
2 | |
3 $ hg clone a b | |
4 abort: repository a not found! | |
5 [255] | |
6 | |
7 No remote source | |
8 | |
9 $ hg clone http://127.0.0.1:3121/a b | |
10 abort: error: Connection refused | |
11 [255] | |
12 $ rm -rf b # work around bug with http clone | |
13 | |
14 Inaccessible source | |
15 | |
16 $ mkdir a | |
17 $ chmod 000 a | |
18 $ hg clone a b | |
19 abort: repository a not found! | |
20 [255] | |
21 | |
22 Inaccessible destination | |
23 | |
24 $ mkdir b | |
25 $ cd b | |
26 $ hg init | |
27 $ hg clone . ../a | |
28 abort: Permission denied: ../a | |
29 [255] | |
30 $ cd .. | |
31 $ chmod 700 a | |
32 $ rm -r a b | |
33 | |
34 Source of wrong type | |
35 | |
36 $ if "$TESTDIR/hghave" -q fifo; then | |
37 > mkfifo a | |
38 > hg clone a b | |
39 > rm a | |
40 > else | |
41 > echo "abort: repository a not found!" | |
42 > echo 255 | |
43 > fi | |
44 abort: repository a not found! | |
45 | |
46 Default destination, same directory | |
47 | |
48 $ mkdir q | |
49 $ cd q | |
50 $ hg init | |
51 $ cd .. | |
52 $ hg clone q | |
53 destination directory: q | |
54 abort: destination 'q' is not empty | |
55 [255] | |
56 | |
57 destination directory not empty | |
58 | |
59 $ mkdir a | |
60 $ echo stuff > a/a | |
61 $ hg clone q a | |
62 abort: destination 'a' is not empty | |
63 [255] | |
64 | |
65 leave existing directory in place after clone failure | |
66 | |
67 $ hg init c | |
68 $ cd c | |
69 $ echo c > c | |
70 $ hg commit -A -m test | |
71 adding c | |
72 $ chmod -rx .hg/store/data | |
73 $ cd .. | |
74 $ mkdir d | |
75 $ hg clone c d 2> err | |
76 [255] | |
77 $ test -d d | |
78 $ test -d d/.hg | |
79 [1] | |
80 | |
81 reenable perm to allow deletion | |
82 | |
83 $ chmod +rx c/.hg/store/data |