Show More
@@ -1,79 +1,90 | |||||
1 | #require killdaemons |
|
1 | #require killdaemons | |
2 |
|
2 | |||
|
3 | #if no-windows | |||
|
4 | For debugging: this is a pretty simple test that is a good candidate | |||
|
5 | for tracking down network-related bugs. Sometimes a command in this | |||
|
6 | hangs, so having showstack pre-loaded is sometimes helpful. This also | |||
|
7 | gives us a test that at least proves showstack can be loaded. | |||
|
8 | $ cat >> $HGRCPATH <<EOF | |||
|
9 | > [extensions] | |||
|
10 | > showstack = $TESTDIR/../contrib/showstack.py | |||
|
11 | > EOF | |||
|
12 | #endif | |||
|
13 | ||||
3 |
$ |
|
14 | $ hg init test | |
4 | $ cd test |
|
15 | $ cd test | |
5 | $ echo a > a |
|
16 | $ echo a > a | |
6 | $ hg ci -Ama |
|
17 | $ hg ci -Ama | |
7 | adding a |
|
18 | adding a | |
8 | $ cd .. |
|
19 | $ cd .. | |
9 | $ hg clone test test2 |
|
20 | $ hg clone test test2 | |
10 | updating to branch default |
|
21 | updating to branch default | |
11 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
22 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
12 | $ cd test2 |
|
23 | $ cd test2 | |
13 | $ echo a >> a |
|
24 | $ echo a >> a | |
14 | $ hg ci -mb |
|
25 | $ hg ci -mb | |
15 |
|
26 | |||
16 | Cloning with a password in the URL should not save the password in .hg/hgrc: |
|
27 | Cloning with a password in the URL should not save the password in .hg/hgrc: | |
17 |
|
28 | |||
18 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
29 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
19 | $ cat hg.pid >> $DAEMON_PIDS |
|
30 | $ cat hg.pid >> $DAEMON_PIDS | |
20 | $ hg clone http://foo:xyzzy@localhost:$HGPORT/ test3 |
|
31 | $ hg clone http://foo:xyzzy@localhost:$HGPORT/ test3 | |
21 | requesting all changes |
|
32 | requesting all changes | |
22 | adding changesets |
|
33 | adding changesets | |
23 | adding manifests |
|
34 | adding manifests | |
24 | adding file changes |
|
35 | adding file changes | |
25 | added 2 changesets with 2 changes to 1 files |
|
36 | added 2 changesets with 2 changes to 1 files | |
26 | new changesets cb9a9f314b8b:ba677d0156c1 |
|
37 | new changesets cb9a9f314b8b:ba677d0156c1 | |
27 | updating to branch default |
|
38 | updating to branch default | |
28 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
39 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
29 | $ cat test3/.hg/hgrc |
|
40 | $ cat test3/.hg/hgrc | |
30 | # example repository config (see 'hg help config' for more info) |
|
41 | # example repository config (see 'hg help config' for more info) | |
31 | [paths] |
|
42 | [paths] | |
32 | default = http://foo@localhost:$HGPORT/ |
|
43 | default = http://foo@localhost:$HGPORT/ | |
33 |
|
44 | |||
34 | # path aliases to other clones of this repo in URLs or filesystem paths |
|
45 | # path aliases to other clones of this repo in URLs or filesystem paths | |
35 | # (see 'hg help config.paths' for more info) |
|
46 | # (see 'hg help config.paths' for more info) | |
36 | # |
|
47 | # | |
37 | # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork |
|
48 | # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork | |
38 | # my-fork = ssh://jdoe@example.net/hg/jdoes-fork |
|
49 | # my-fork = ssh://jdoe@example.net/hg/jdoes-fork | |
39 | # my-clone = /home/jdoe/jdoes-clone |
|
50 | # my-clone = /home/jdoe/jdoes-clone | |
40 |
|
51 | |||
41 | [ui] |
|
52 | [ui] | |
42 | # name and email (local to this repository, optional), e.g. |
|
53 | # name and email (local to this repository, optional), e.g. | |
43 | # username = Jane Doe <jdoe@example.com> |
|
54 | # username = Jane Doe <jdoe@example.com> | |
44 | $ killdaemons.py |
|
55 | $ killdaemons.py | |
45 |
|
56 | |||
46 | expect error, cloning not allowed |
|
57 | expect error, cloning not allowed | |
47 |
|
58 | |||
48 | $ echo '[web]' > .hg/hgrc |
|
59 | $ echo '[web]' > .hg/hgrc | |
49 | $ echo 'allowpull = false' >> .hg/hgrc |
|
60 | $ echo 'allowpull = false' >> .hg/hgrc | |
50 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
61 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
51 | $ cat hg.pid >> $DAEMON_PIDS |
|
62 | $ cat hg.pid >> $DAEMON_PIDS | |
52 | $ hg clone http://localhost:$HGPORT/ test4 # bundle2+ |
|
63 | $ hg clone http://localhost:$HGPORT/ test4 # bundle2+ | |
53 | abort: authorization failed |
|
64 | abort: authorization failed | |
54 | [255] |
|
65 | [255] | |
55 | $ hg clone http://localhost:$HGPORT/ test4 --config devel.legacy.exchange=bundle1 |
|
66 | $ hg clone http://localhost:$HGPORT/ test4 --config devel.legacy.exchange=bundle1 | |
56 | abort: authorization failed |
|
67 | abort: authorization failed | |
57 | [255] |
|
68 | [255] | |
58 | $ killdaemons.py |
|
69 | $ killdaemons.py | |
59 |
|
70 | |||
60 | serve errors |
|
71 | serve errors | |
61 |
|
72 | |||
62 | $ cat errors.log |
|
73 | $ cat errors.log | |
63 | $ req() { |
|
74 | $ req() { | |
64 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
75 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
65 | > cat hg.pid >> $DAEMON_PIDS |
|
76 | > cat hg.pid >> $DAEMON_PIDS | |
66 | > hg --cwd ../test pull http://localhost:$HGPORT/ |
|
77 | > hg --cwd ../test pull http://localhost:$HGPORT/ | |
67 | > killdaemons.py hg.pid |
|
78 | > killdaemons.py hg.pid | |
68 | > echo % serve errors |
|
79 | > echo % serve errors | |
69 | > cat errors.log |
|
80 | > cat errors.log | |
70 | > } |
|
81 | > } | |
71 |
|
82 | |||
72 | expect error, pulling not allowed |
|
83 | expect error, pulling not allowed | |
73 |
|
84 | |||
74 | $ req |
|
85 | $ req | |
75 | pulling from http://localhost:$HGPORT/ |
|
86 | pulling from http://localhost:$HGPORT/ | |
76 | abort: authorization failed |
|
87 | abort: authorization failed | |
77 | % serve errors |
|
88 | % serve errors | |
78 |
|
89 | |||
79 | $ cd .. |
|
90 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now