Show More
@@ -398,7 +398,7 b' def clone(ui, peeropts, source, dest=Non' | |||||
398 |
|
398 | |||
399 | if update: |
|
399 | if update: | |
400 | if update is not True: |
|
400 | if update is not True: | |
401 |
checkout = src |
|
401 | checkout = srcpeer.lookup(update) | |
402 | for test in (checkout, 'default', 'tip'): |
|
402 | for test in (checkout, 'default', 'tip'): | |
403 | if test is None: |
|
403 | if test is None: | |
404 | continue |
|
404 | continue |
@@ -77,6 +77,24 b' clone via pull' | |||||
77 | adding bar |
|
77 | adding bar | |
78 | $ cd .. |
|
78 | $ cd .. | |
79 |
|
79 | |||
|
80 | clone over http with --update | |||
|
81 | ||||
|
82 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 | |||
|
83 | requesting all changes | |||
|
84 | adding changesets | |||
|
85 | adding manifests | |||
|
86 | adding file changes | |||
|
87 | added 2 changesets with 5 changes to 5 files | |||
|
88 | updating to branch default | |||
|
89 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
90 | $ hg log -r . -R updated | |||
|
91 | changeset: 0:8b6053c928fe | |||
|
92 | user: test | |||
|
93 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
94 | summary: 1 | |||
|
95 | ||||
|
96 | $ rm -rf updated | |||
|
97 | ||||
80 | incoming via HTTP |
|
98 | incoming via HTTP | |
81 |
|
99 | |||
82 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial |
|
100 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial | |
@@ -129,7 +147,7 b' test http authentication' | |||||
129 | > if not auth: |
|
147 | > if not auth: | |
130 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', |
|
148 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', | |
131 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) |
|
149 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) | |
132 |
> if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: |
|
150 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: | |
133 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') |
|
151 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') | |
134 | > def extsetup(): |
|
152 | > def extsetup(): | |
135 | > common.permhooks.insert(0, perform_authentication) |
|
153 | > common.permhooks.insert(0, perform_authentication) | |
@@ -138,24 +156,24 b' test http authentication' | |||||
138 | > --config server.preferuncompressed=True |
|
156 | > --config server.preferuncompressed=True | |
139 | $ cat pid >> $DAEMON_PIDS |
|
157 | $ cat pid >> $DAEMON_PIDS | |
140 |
|
158 | |||
141 |
$ hg id http://localhost:$HGPORT2/ |
|
159 | $ hg id http://localhost:$HGPORT2/ | |
142 | abort: http authorization required |
|
160 | abort: http authorization required | |
143 | [255] |
|
161 | [255] | |
144 |
$ hg id http://user@localhost:$HGPORT2/ |
|
162 | $ hg id http://user@localhost:$HGPORT2/ | |
145 | abort: http authorization required |
|
163 | abort: http authorization required | |
146 | [255] |
|
164 | [255] | |
147 | $ hg id http://user:pass@localhost:$HGPORT2/ |
|
165 | $ hg id http://user:pass@localhost:$HGPORT2/ | |
148 | 5fed3813f7f5 |
|
166 | 5fed3813f7f5 | |
149 |
$ echo '[auth]' >> .hg/hgrc |
|
167 | $ echo '[auth]' >> .hg/hgrc | |
150 | $ echo 'l.schemes=http' >> .hg/hgrc |
|
168 | $ echo 'l.schemes=http' >> .hg/hgrc | |
151 | $ echo 'l.prefix=lo' >> .hg/hgrc |
|
169 | $ echo 'l.prefix=lo' >> .hg/hgrc | |
152 | $ echo 'l.username=user' >> .hg/hgrc |
|
170 | $ echo 'l.username=user' >> .hg/hgrc | |
153 | $ echo 'l.password=pass' >> .hg/hgrc |
|
171 | $ echo 'l.password=pass' >> .hg/hgrc | |
154 |
$ hg id http://localhost:$HGPORT2/ |
|
172 | $ hg id http://localhost:$HGPORT2/ | |
155 | 5fed3813f7f5 |
|
173 | 5fed3813f7f5 | |
156 |
$ hg id http://localhost:$HGPORT2/ |
|
174 | $ hg id http://localhost:$HGPORT2/ | |
157 | 5fed3813f7f5 |
|
175 | 5fed3813f7f5 | |
158 |
$ hg id http://user@localhost:$HGPORT2/ |
|
176 | $ hg id http://user@localhost:$HGPORT2/ | |
159 | 5fed3813f7f5 |
|
177 | 5fed3813f7f5 | |
160 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 |
|
178 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 | |
161 | streaming all changes |
|
179 | streaming all changes | |
@@ -164,7 +182,7 b' test http authentication' | |||||
164 | updating to branch default |
|
182 | updating to branch default | |
165 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
183 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
166 |
|
184 | |||
167 |
$ hg id http://user2@localhost:$HGPORT2/ |
|
185 | $ hg id http://user2@localhost:$HGPORT2/ | |
168 | abort: http authorization required |
|
186 | abort: http authorization required | |
169 | [255] |
|
187 | [255] | |
170 | $ hg id http://user:pass2@localhost:$HGPORT2/ |
|
188 | $ hg id http://user:pass2@localhost:$HGPORT2/ |
General Comments 0
You need to be logged in to leave comments.
Login now