author | Mads Kiilerich <mads@kiilerich.com> |
Fri, 05 Aug 2011 00:39:54 +0200 | |
branch | stable |
changeset 15026 | f32a2989ff58 |
parent 14161 | 8a0fca925992 |
child 15055 | d629f1e89021 |
permissions | -rw-r--r-- |
2612
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff
changeset
|
1 |
|
12446 | 2 |
$ hg init test |
3 |
$ cd test |
|
4 |
$ echo foo>foo |
|
5 |
$ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg |
|
6 |
$ echo foo>foo.d/foo |
|
7 |
$ echo bar>foo.d/bAr.hg.d/BaR |
|
8 |
$ echo bar>foo.d/baR.d.hg/bAR |
|
9 |
$ hg commit -A -m 1 |
|
10 |
adding foo |
|
11 |
adding foo.d/bAr.hg.d/BaR |
|
12 |
adding foo.d/baR.d.hg/bAR |
|
13 |
adding foo.d/foo |
|
13445
61a898576888
hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents:
13439
diff
changeset
|
14 |
$ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log |
12446 | 15 |
$ hg --config server.uncompressed=False serve -p $HGPORT1 -d --pid-file=../hg2.pid |
16 |
||
17 |
Test server address cannot be reused |
|
4289
e17598881509
test-http: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4130
diff
changeset
|
18 |
|
12446 | 19 |
$ hg serve -p $HGPORT1 2>&1 |
12643
d08bb64888bc
tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents:
12446
diff
changeset
|
20 |
abort: cannot start server at ':$HGPORT1': Address already in use |
12446 | 21 |
[255] |
22 |
$ cd .. |
|
23 |
$ cat hg1.pid hg2.pid >> $DAEMON_PIDS |
|
24 |
||
25 |
clone via stream |
|
9506
49b62395e910
streamclone: partially encode filename over the wire, not for local read (issue1847)
Greg Ward <greg-hg@gerg.ca>
parents:
8167
diff
changeset
|
26 |
|
12446 | 27 |
$ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 |
28 |
streaming all changes |
|
29 |
6 files to transfer, 606 bytes of data |
|
14023
2cd1520664b8
tests: check for (*/sec) instead of (*B/sec) to match (X bytes/sec)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
13445
diff
changeset
|
30 |
transferred * bytes in * seconds (*/sec) (glob) |
12446 | 31 |
updating to branch default |
32 |
4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
33 |
$ hg verify -R copy |
|
34 |
checking changesets |
|
35 |
checking manifests |
|
36 |
crosschecking files in changesets and manifests |
|
37 |
checking files |
|
38 |
4 files, 1 changesets, 4 total revisions |
|
39 |
||
40 |
try to clone via stream, should use pull instead |
|
2612
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff
changeset
|
41 |
|
12446 | 42 |
$ hg clone --uncompressed http://localhost:$HGPORT1/ copy2 |
43 |
requesting all changes |
|
44 |
adding changesets |
|
45 |
adding manifests |
|
46 |
adding file changes |
|
47 |
added 1 changesets with 4 changes to 4 files |
|
48 |
updating to branch default |
|
49 |
4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
2612
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff
changeset
|
50 |
|
12446 | 51 |
clone via pull |
2673
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2622
diff
changeset
|
52 |
|
12446 | 53 |
$ hg clone http://localhost:$HGPORT1/ copy-pull |
54 |
requesting all changes |
|
55 |
adding changesets |
|
56 |
adding manifests |
|
57 |
adding file changes |
|
58 |
added 1 changesets with 4 changes to 4 files |
|
59 |
updating to branch default |
|
60 |
4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
61 |
$ hg verify -R copy-pull |
|
62 |
checking changesets |
|
63 |
checking manifests |
|
64 |
crosschecking files in changesets and manifests |
|
65 |
checking files |
|
66 |
4 files, 1 changesets, 4 total revisions |
|
67 |
$ cd test |
|
68 |
$ echo bar > bar |
|
69 |
$ hg commit -A -d '1 0' -m 2 |
|
70 |
adding bar |
|
71 |
$ cd .. |
|
2673
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2622
diff
changeset
|
72 |
|
14161
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
73 |
incoming via HTTP |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
74 |
|
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
75 |
$ hg clone http://localhost:$HGPORT1/ --rev 0 partial |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
76 |
adding changesets |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
77 |
adding manifests |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
78 |
adding file changes |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
79 |
added 1 changesets with 4 changes to 4 files |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
80 |
updating to branch default |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
81 |
4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
82 |
$ cd partial |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
83 |
$ touch LOCAL |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
84 |
$ hg ci -qAm LOCAL |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
85 |
$ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
86 |
comparing with http://localhost:$HGPORT1/ |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
87 |
searching for changes |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
88 |
2 |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
89 |
$ cd .. |
8a0fca925992
bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14023
diff
changeset
|
90 |
|
12446 | 91 |
pull |
92 |
||
93 |
$ cd copy-pull |
|
94 |
$ echo '[hooks]' >> .hg/hgrc |
|
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
12643
diff
changeset
|
95 |
$ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup' >> .hg/hgrc |
12446 | 96 |
$ hg pull |
12643
d08bb64888bc
tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents:
12446
diff
changeset
|
97 |
pulling from http://localhost:$HGPORT1/ |
12446 | 98 |
searching for changes |
99 |
adding changesets |
|
100 |
adding manifests |
|
101 |
adding file changes |
|
102 |
added 1 changesets with 1 changes to 1 files |
|
13439
d724a69309e0
util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents:
13405
diff
changeset
|
103 |
changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost:$HGPORT1/ |
12446 | 104 |
(run 'hg update' to get a working copy) |
105 |
$ cd .. |
|
13445
61a898576888
hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents:
13439
diff
changeset
|
106 |
|
61a898576888
hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents:
13439
diff
changeset
|
107 |
clone from invalid URL |
61a898576888
hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents:
13439
diff
changeset
|
108 |
|
61a898576888
hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents:
13439
diff
changeset
|
109 |
$ hg clone http://localhost:$HGPORT/bad |
61a898576888
hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents:
13439
diff
changeset
|
110 |
abort: HTTP Error 404: Not Found |
61a898576888
hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents:
13439
diff
changeset
|
111 |
[255] |
61a898576888
hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents:
13439
diff
changeset
|
112 |
|
15026
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
113 |
test http authentication |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
114 |
|
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
115 |
$ cd test |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
116 |
$ cat << EOT > userpass.py |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
117 |
> import base64 |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
118 |
> from mercurial.hgweb import common |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
119 |
> def perform_authentication(hgweb, req, op): |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
120 |
> auth = req.env.get('HTTP_AUTHORIZATION') |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
121 |
> if not auth: |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
122 |
> raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
123 |
> [('WWW-Authenticate', 'Basic Realm="mercurial"')]) |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
124 |
> if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
125 |
> raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
126 |
> def extsetup(): |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
127 |
> common.permhooks.insert(0, perform_authentication) |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
128 |
> EOT |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
129 |
$ hg --config extensions.x=userpass.py serve -p $HGPORT2 -d --pid-file=pid |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
130 |
$ cat pid >> $DAEMON_PIDS |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
131 |
|
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
132 |
$ hg id http://localhost:$HGPORT2/ |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
133 |
abort: http authorization required |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
134 |
[255] |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
135 |
$ hg id http://user@localhost:$HGPORT2/ |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
136 |
abort: http authorization required |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
137 |
[255] |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
138 |
$ hg id http://user:pass@localhost:$HGPORT2/ |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
139 |
5fed3813f7f5 |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
140 |
$ echo '[auth]' >> .hg/hgrc |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
141 |
$ echo 'l.schemes=http' >> .hg/hgrc |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
142 |
$ echo 'l.prefix=lo' >> .hg/hgrc |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
143 |
$ echo 'l.username=user' >> .hg/hgrc |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
144 |
$ echo 'l.password=pass' >> .hg/hgrc |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
145 |
$ hg id http://localhost:$HGPORT2/ |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
146 |
5fed3813f7f5 |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
147 |
$ hg id http://localhost:$HGPORT2/ |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
148 |
5fed3813f7f5 |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
149 |
$ hg id http://user@localhost:$HGPORT2/ |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
150 |
5fed3813f7f5 |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
151 |
$ hg id http://user:pass@localhost:$HGPORT2/ |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
152 |
5fed3813f7f5 |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
153 |
$ hg id http://user2@localhost:$HGPORT2/ |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
154 |
abort: http authorization required |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
155 |
[255] |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
156 |
$ hg id http://user:pass2@localhost:$HGPORT2/ |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
157 |
abort: HTTP Error 403: no |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
158 |
[255] |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
159 |
|
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
160 |
$ cd .. |
f32a2989ff58
test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents:
14161
diff
changeset
|
161 |
|
13445
61a898576888
hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents:
13439
diff
changeset
|
162 |
check error log |
61a898576888
hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents:
13439
diff
changeset
|
163 |
|
61a898576888
hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents:
13439
diff
changeset
|
164 |
$ cat error.log |