Show More
@@ -1,75 +1,79 | |||
|
1 | 1 | #require killdaemons |
|
2 | 2 | |
|
3 | 3 | $ hg init test |
|
4 | 4 | $ cd test |
|
5 | 5 | $ echo a > a |
|
6 | 6 | $ hg ci -Ama |
|
7 | 7 | adding a |
|
8 | 8 | $ cd .. |
|
9 | 9 | $ hg clone test test2 |
|
10 | 10 | updating to branch default |
|
11 | 11 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
12 | 12 | $ cd test2 |
|
13 | 13 | $ echo a >> a |
|
14 | 14 | $ hg ci -mb |
|
15 | 15 | |
|
16 | 16 | Cloning with a password in the URL should not save the password in .hg/hgrc: |
|
17 | 17 | |
|
18 | 18 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
19 | 19 | $ cat hg.pid >> $DAEMON_PIDS |
|
20 | 20 | $ hg clone http://foo:xyzzy@localhost:$HGPORT/ test3 |
|
21 | 21 | requesting all changes |
|
22 | 22 | adding changesets |
|
23 | 23 | adding manifests |
|
24 | 24 | adding file changes |
|
25 | 25 | added 2 changesets with 2 changes to 1 files |
|
26 | 26 | updating to branch default |
|
27 | 27 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
28 | 28 | $ cat test3/.hg/hgrc |
|
29 | 29 | # example repository config (see "hg help config" for more info) |
|
30 | 30 | [paths] |
|
31 | 31 | default = http://foo@localhost:$HGPORT/ |
|
32 | 32 | |
|
33 | 33 | # path aliases to other clones of this repo in URLs or filesystem paths |
|
34 | 34 | # (see "hg help config.paths" for more info) |
|
35 | 35 | # |
|
36 | 36 | # default-push = ssh://jdoe@example.net/hg/jdoes-fork |
|
37 | 37 | # my-fork = ssh://jdoe@example.net/hg/jdoes-fork |
|
38 | 38 | # my-clone = /home/jdoe/jdoes-clone |
|
39 | 39 | |
|
40 | 40 | [ui] |
|
41 | 41 | # name and email (local to this repository, optional), e.g. |
|
42 | 42 | # username = Jane Doe <jdoe@example.com> |
|
43 | 43 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
44 | 44 | |
|
45 | 45 | expect error, cloning not allowed |
|
46 | 46 | |
|
47 | 47 | $ echo '[web]' > .hg/hgrc |
|
48 | 48 | $ echo 'allowpull = false' >> .hg/hgrc |
|
49 | 49 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
50 | 50 | $ cat hg.pid >> $DAEMON_PIDS |
|
51 | $ hg clone http://localhost:$HGPORT/ test4 | |
|
51 | $ hg clone http://localhost:$HGPORT/ test4 --config experimental.bundle2-exp=True | |
|
52 | requesting all changes | |
|
53 | abort: authorization failed | |
|
54 | [255] | |
|
55 | $ hg clone http://localhost:$HGPORT/ test4 --config experimental.bundle2-exp=False | |
|
52 | 56 | abort: authorization failed |
|
53 | 57 | [255] |
|
54 | 58 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
55 | 59 | |
|
56 | 60 | serve errors |
|
57 | 61 | |
|
58 | 62 | $ cat errors.log |
|
59 | 63 | $ req() { |
|
60 | 64 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
61 | 65 | > cat hg.pid >> $DAEMON_PIDS |
|
62 | 66 | > hg --cwd ../test pull http://localhost:$HGPORT/ |
|
63 | 67 | > "$TESTDIR/killdaemons.py" hg.pid |
|
64 | 68 | > echo % serve errors |
|
65 | 69 | > cat errors.log |
|
66 | 70 | > } |
|
67 | 71 | |
|
68 | 72 | expect error, pulling not allowed |
|
69 | 73 | |
|
70 | 74 | $ req |
|
71 | 75 | pulling from http://localhost:$HGPORT/ |
|
72 | 76 | abort: authorization failed |
|
73 | 77 | % serve errors |
|
74 | 78 | |
|
75 | 79 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now