Show More
@@ -1,338 +1,382 b'' | |||
|
1 | 1 | # httppeer.py - HTTP repository proxy classes for mercurial |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> |
|
4 | 4 | # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> |
|
5 | 5 | # |
|
6 | 6 | # This software may be used and distributed according to the terms of the |
|
7 | 7 | # GNU General Public License version 2 or any later version. |
|
8 | 8 | |
|
9 | 9 | from __future__ import absolute_import |
|
10 | 10 | |
|
11 | 11 | import errno |
|
12 | 12 | import os |
|
13 | 13 | import socket |
|
14 | import struct | |
|
14 | 15 | import tempfile |
|
15 | 16 | |
|
16 | 17 | from .i18n import _ |
|
17 | 18 | from .node import nullid |
|
18 | 19 | from . import ( |
|
19 | 20 | bundle2, |
|
20 | 21 | error, |
|
21 | 22 | httpconnection, |
|
22 | 23 | statichttprepo, |
|
23 | 24 | url, |
|
24 | 25 | util, |
|
25 | 26 | wireproto, |
|
26 | 27 | ) |
|
27 | 28 | |
|
28 | 29 | httplib = util.httplib |
|
29 | 30 | urlerr = util.urlerr |
|
30 | 31 | urlreq = util.urlreq |
|
31 | 32 | |
|
32 | 33 | # FUTURE: consider refactoring this API to use generators. This will |
|
33 | 34 | # require a compression engine API to emit generators. |
|
34 | 35 | def decompressresponse(response, engine): |
|
35 | 36 | try: |
|
36 | 37 | reader = engine.decompressorreader(response) |
|
37 | 38 | except httplib.HTTPException: |
|
38 | 39 | raise IOError(None, _('connection ended unexpectedly')) |
|
39 | 40 | |
|
40 | 41 | # We need to wrap reader.read() so HTTPException on subsequent |
|
41 | 42 | # reads is also converted. |
|
42 | 43 | # Ideally we'd use super() here. However, if ``reader`` isn't a new-style |
|
43 | 44 | # class, this can raise: |
|
44 | 45 | # TypeError: super() argument 1 must be type, not classobj |
|
45 | 46 | origread = reader.read |
|
46 | 47 | class readerproxy(reader.__class__): |
|
47 | 48 | def read(self, *args, **kwargs): |
|
48 | 49 | try: |
|
49 | 50 | return origread(*args, **kwargs) |
|
50 | 51 | except httplib.HTTPException: |
|
51 | 52 | raise IOError(None, _('connection ended unexpectedly')) |
|
52 | 53 | |
|
53 | 54 | reader.__class__ = readerproxy |
|
54 | 55 | return reader |
|
55 | 56 | |
|
56 | 57 | def encodevalueinheaders(value, header, limit): |
|
57 | 58 | """Encode a string value into multiple HTTP headers. |
|
58 | 59 | |
|
59 | 60 | ``value`` will be encoded into 1 or more HTTP headers with the names |
|
60 | 61 | ``header-<N>`` where ``<N>`` is an integer starting at 1. Each header |
|
61 | 62 | name + value will be at most ``limit`` bytes long. |
|
62 | 63 | |
|
63 | 64 | Returns an iterable of 2-tuples consisting of header names and values. |
|
64 | 65 | """ |
|
65 | 66 | fmt = header + '-%s' |
|
66 | 67 | valuelen = limit - len(fmt % '000') - len(': \r\n') |
|
67 | 68 | result = [] |
|
68 | 69 | |
|
69 | 70 | n = 0 |
|
70 | 71 | for i in xrange(0, len(value), valuelen): |
|
71 | 72 | n += 1 |
|
72 | 73 | result.append((fmt % str(n), value[i:i + valuelen])) |
|
73 | 74 | |
|
74 | 75 | return result |
|
75 | 76 | |
|
76 | 77 | class httppeer(wireproto.wirepeer): |
|
77 | 78 | def __init__(self, ui, path): |
|
78 | 79 | self.path = path |
|
79 | 80 | self.caps = None |
|
80 | 81 | self.handler = None |
|
81 | 82 | self.urlopener = None |
|
82 | 83 | self.requestbuilder = None |
|
83 | 84 | u = util.url(path) |
|
84 | 85 | if u.query or u.fragment: |
|
85 | 86 | raise error.Abort(_('unsupported URL component: "%s"') % |
|
86 | 87 | (u.query or u.fragment)) |
|
87 | 88 | |
|
88 | 89 | # urllib cannot handle URLs with embedded user or passwd |
|
89 | 90 | self._url, authinfo = u.authinfo() |
|
90 | 91 | |
|
91 | 92 | self.ui = ui |
|
92 | 93 | self.ui.debug('using %s\n' % self._url) |
|
93 | 94 | |
|
94 | 95 | self.urlopener = url.opener(ui, authinfo) |
|
95 | 96 | self.requestbuilder = urlreq.request |
|
96 | 97 | |
|
97 | 98 | def __del__(self): |
|
98 | 99 | urlopener = getattr(self, 'urlopener', None) |
|
99 | 100 | if urlopener: |
|
100 | 101 | for h in urlopener.handlers: |
|
101 | 102 | h.close() |
|
102 | 103 | getattr(h, "close_all", lambda : None)() |
|
103 | 104 | |
|
104 | 105 | def url(self): |
|
105 | 106 | return self.path |
|
106 | 107 | |
|
107 | 108 | # look up capabilities only when needed |
|
108 | 109 | |
|
109 | 110 | def _fetchcaps(self): |
|
110 | 111 | self.caps = set(self._call('capabilities').split()) |
|
111 | 112 | |
|
112 | 113 | def _capabilities(self): |
|
113 | 114 | if self.caps is None: |
|
114 | 115 | try: |
|
115 | 116 | self._fetchcaps() |
|
116 | 117 | except error.RepoError: |
|
117 | 118 | self.caps = set() |
|
118 | 119 | self.ui.debug('capabilities: %s\n' % |
|
119 | 120 | (' '.join(self.caps or ['none']))) |
|
120 | 121 | return self.caps |
|
121 | 122 | |
|
122 | 123 | def lock(self): |
|
123 | 124 | raise error.Abort(_('operation not supported over http')) |
|
124 | 125 | |
|
125 | 126 | def _callstream(self, cmd, _compressible=False, **args): |
|
126 | 127 | if cmd == 'pushkey': |
|
127 | 128 | args['data'] = '' |
|
128 | 129 | data = args.pop('data', None) |
|
129 | 130 | headers = args.pop('headers', {}) |
|
130 | 131 | |
|
131 | 132 | self.ui.debug("sending %s command\n" % cmd) |
|
132 | 133 | q = [('cmd', cmd)] |
|
133 | 134 | headersize = 0 |
|
134 | 135 | varyheaders = [] |
|
135 | 136 | # Important: don't use self.capable() here or else you end up |
|
136 | 137 | # with infinite recursion when trying to look up capabilities |
|
137 | 138 | # for the first time. |
|
138 | 139 | postargsok = self.caps is not None and 'httppostargs' in self.caps |
|
139 | 140 | # TODO: support for httppostargs when data is a file-like |
|
140 | 141 | # object rather than a basestring |
|
141 | 142 | canmungedata = not data or isinstance(data, basestring) |
|
142 | 143 | if postargsok and canmungedata: |
|
143 | 144 | strargs = urlreq.urlencode(sorted(args.items())) |
|
144 | 145 | if strargs: |
|
145 | 146 | if not data: |
|
146 | 147 | data = strargs |
|
147 | 148 | elif isinstance(data, basestring): |
|
148 | 149 | data = strargs + data |
|
149 | 150 | headers['X-HgArgs-Post'] = len(strargs) |
|
150 | 151 | else: |
|
151 | 152 | if len(args) > 0: |
|
152 | 153 | httpheader = self.capable('httpheader') |
|
153 | 154 | if httpheader: |
|
154 | 155 | headersize = int(httpheader.split(',', 1)[0]) |
|
155 | 156 | if headersize > 0: |
|
156 | 157 | # The headers can typically carry more data than the URL. |
|
157 | 158 | encargs = urlreq.urlencode(sorted(args.items())) |
|
158 | 159 | for header, value in encodevalueinheaders(encargs, 'X-HgArg', |
|
159 | 160 | headersize): |
|
160 | 161 | headers[header] = value |
|
161 | 162 | varyheaders.append(header) |
|
162 | 163 | else: |
|
163 | 164 | q += sorted(args.items()) |
|
164 | 165 | qs = '?%s' % urlreq.urlencode(q) |
|
165 | 166 | cu = "%s%s" % (self._url, qs) |
|
166 | 167 | size = 0 |
|
167 | 168 | if util.safehasattr(data, 'length'): |
|
168 | 169 | size = data.length |
|
169 | 170 | elif data is not None: |
|
170 | 171 | size = len(data) |
|
171 | 172 | if size and self.ui.configbool('ui', 'usehttp2', False): |
|
172 | 173 | headers['Expect'] = '100-Continue' |
|
173 | 174 | headers['X-HgHttp2'] = '1' |
|
174 | 175 | if data is not None and 'Content-Type' not in headers: |
|
175 | 176 | headers['Content-Type'] = 'application/mercurial-0.1' |
|
176 | 177 | |
|
178 | # Tell the server we accept application/mercurial-0.2 and multiple | |
|
179 | # compression formats if the server is capable of emitting those | |
|
180 | # payloads. | |
|
181 | protoparams = [] | |
|
182 | ||
|
183 | mediatypes = set() | |
|
184 | if self.caps is not None: | |
|
185 | mt = self.capable('httpmediatype') | |
|
186 | if mt: | |
|
187 | protoparams.append('0.1') | |
|
188 | mediatypes = set(mt.split(',')) | |
|
189 | ||
|
190 | if '0.2tx' in mediatypes: | |
|
191 | protoparams.append('0.2') | |
|
192 | ||
|
193 | if '0.2tx' in mediatypes and self.capable('compression'): | |
|
194 | # We /could/ compare supported compression formats and prune | |
|
195 | # non-mutually supported or error if nothing is mutually supported. | |
|
196 | # For now, send the full list to the server and have it error. | |
|
197 | comps = [e.wireprotosupport().name for e in | |
|
198 | util.compengines.supportedwireengines(util.CLIENTROLE)] | |
|
199 | protoparams.append('comp=%s' % ','.join(comps)) | |
|
200 | ||
|
201 | if protoparams: | |
|
202 | protoheaders = encodevalueinheaders(' '.join(protoparams), | |
|
203 | 'X-HgProto', | |
|
204 | headersize or 1024) | |
|
205 | for header, value in protoheaders: | |
|
206 | headers[header] = value | |
|
207 | varyheaders.append(header) | |
|
208 | ||
|
177 | 209 | headers['Vary'] = ','.join(varyheaders) |
|
178 | 210 | req = self.requestbuilder(cu, data, headers) |
|
179 | 211 | |
|
180 | 212 | if data is not None: |
|
181 | 213 | self.ui.debug("sending %s bytes\n" % size) |
|
182 | 214 | req.add_unredirected_header('Content-Length', '%d' % size) |
|
183 | 215 | try: |
|
184 | 216 | resp = self.urlopener.open(req) |
|
185 | 217 | except urlerr.httperror as inst: |
|
186 | 218 | if inst.code == 401: |
|
187 | 219 | raise error.Abort(_('authorization failed')) |
|
188 | 220 | raise |
|
189 | 221 | except httplib.HTTPException as inst: |
|
190 | 222 | self.ui.debug('http error while sending %s command\n' % cmd) |
|
191 | 223 | self.ui.traceback() |
|
192 | 224 | raise IOError(None, inst) |
|
193 | 225 | # record the url we got redirected to |
|
194 | 226 | resp_url = resp.geturl() |
|
195 | 227 | if resp_url.endswith(qs): |
|
196 | 228 | resp_url = resp_url[:-len(qs)] |
|
197 | 229 | if self._url.rstrip('/') != resp_url.rstrip('/'): |
|
198 | 230 | if not self.ui.quiet: |
|
199 | 231 | self.ui.warn(_('real URL is %s\n') % resp_url) |
|
200 | 232 | self._url = resp_url |
|
201 | 233 | try: |
|
202 | 234 | proto = resp.getheader('content-type') |
|
203 | 235 | except AttributeError: |
|
204 | 236 | proto = resp.headers.get('content-type', '') |
|
205 | 237 | |
|
206 | 238 | safeurl = util.hidepassword(self._url) |
|
207 | 239 | if proto.startswith('application/hg-error'): |
|
208 | 240 | raise error.OutOfBandError(resp.read()) |
|
209 | 241 | # accept old "text/plain" and "application/hg-changegroup" for now |
|
210 | 242 | if not (proto.startswith('application/mercurial-') or |
|
211 | 243 | (proto.startswith('text/plain') |
|
212 | 244 | and not resp.headers.get('content-length')) or |
|
213 | 245 | proto.startswith('application/hg-changegroup')): |
|
214 | 246 | self.ui.debug("requested URL: '%s'\n" % util.hidepassword(cu)) |
|
215 | 247 | raise error.RepoError( |
|
216 | 248 | _("'%s' does not appear to be an hg repository:\n" |
|
217 | 249 | "---%%<--- (%s)\n%s\n---%%<---\n") |
|
218 | 250 | % (safeurl, proto or 'no content-type', resp.read(1024))) |
|
219 | 251 | |
|
220 | 252 | if proto.startswith('application/mercurial-'): |
|
221 | 253 | try: |
|
222 | 254 | version = proto.split('-', 1)[1] |
|
223 | 255 | version_info = tuple([int(n) for n in version.split('.')]) |
|
224 | 256 | except ValueError: |
|
225 | 257 | raise error.RepoError(_("'%s' sent a broken Content-Type " |
|
226 | 258 | "header (%s)") % (safeurl, proto)) |
|
227 | if version_info > (0, 1): | |
|
259 | ||
|
260 | if version_info == (0, 1): | |
|
261 | if _compressible: | |
|
262 | return decompressresponse(resp, util.compengines['zlib']) | |
|
263 | return resp | |
|
264 | elif version_info == (0, 2): | |
|
265 | # application/mercurial-0.2 always identifies the compression | |
|
266 | # engine in the payload header. | |
|
267 | elen = struct.unpack('B', resp.read(1))[0] | |
|
268 | ename = resp.read(elen) | |
|
269 | engine = util.compengines.forwiretype(ename) | |
|
270 | return decompressresponse(resp, engine) | |
|
271 | else: | |
|
228 | 272 | raise error.RepoError(_("'%s' uses newer protocol %s") % |
|
229 | 273 | (safeurl, version)) |
|
230 | 274 | |
|
231 | 275 | if _compressible: |
|
232 | 276 | return decompressresponse(resp, util.compengines['zlib']) |
|
233 | 277 | |
|
234 | 278 | return resp |
|
235 | 279 | |
|
236 | 280 | def _call(self, cmd, **args): |
|
237 | 281 | fp = self._callstream(cmd, **args) |
|
238 | 282 | try: |
|
239 | 283 | return fp.read() |
|
240 | 284 | finally: |
|
241 | 285 | # if using keepalive, allow connection to be reused |
|
242 | 286 | fp.close() |
|
243 | 287 | |
|
244 | 288 | def _callpush(self, cmd, cg, **args): |
|
245 | 289 | # have to stream bundle to a temp file because we do not have |
|
246 | 290 | # http 1.1 chunked transfer. |
|
247 | 291 | |
|
248 | 292 | types = self.capable('unbundle') |
|
249 | 293 | try: |
|
250 | 294 | types = types.split(',') |
|
251 | 295 | except AttributeError: |
|
252 | 296 | # servers older than d1b16a746db6 will send 'unbundle' as a |
|
253 | 297 | # boolean capability. They only support headerless/uncompressed |
|
254 | 298 | # bundles. |
|
255 | 299 | types = [""] |
|
256 | 300 | for x in types: |
|
257 | 301 | if x in bundle2.bundletypes: |
|
258 | 302 | type = x |
|
259 | 303 | break |
|
260 | 304 | |
|
261 | 305 | tempname = bundle2.writebundle(self.ui, cg, None, type) |
|
262 | 306 | fp = httpconnection.httpsendfile(self.ui, tempname, "rb") |
|
263 | 307 | headers = {'Content-Type': 'application/mercurial-0.1'} |
|
264 | 308 | |
|
265 | 309 | try: |
|
266 | 310 | r = self._call(cmd, data=fp, headers=headers, **args) |
|
267 | 311 | vals = r.split('\n', 1) |
|
268 | 312 | if len(vals) < 2: |
|
269 | 313 | raise error.ResponseError(_("unexpected response:"), r) |
|
270 | 314 | return vals |
|
271 | 315 | except socket.error as err: |
|
272 | 316 | if err.args[0] in (errno.ECONNRESET, errno.EPIPE): |
|
273 | 317 | raise error.Abort(_('push failed: %s') % err.args[1]) |
|
274 | 318 | raise error.Abort(err.args[1]) |
|
275 | 319 | finally: |
|
276 | 320 | fp.close() |
|
277 | 321 | os.unlink(tempname) |
|
278 | 322 | |
|
279 | 323 | def _calltwowaystream(self, cmd, fp, **args): |
|
280 | 324 | fh = None |
|
281 | 325 | fp_ = None |
|
282 | 326 | filename = None |
|
283 | 327 | try: |
|
284 | 328 | # dump bundle to disk |
|
285 | 329 | fd, filename = tempfile.mkstemp(prefix="hg-bundle-", suffix=".hg") |
|
286 | 330 | fh = os.fdopen(fd, "wb") |
|
287 | 331 | d = fp.read(4096) |
|
288 | 332 | while d: |
|
289 | 333 | fh.write(d) |
|
290 | 334 | d = fp.read(4096) |
|
291 | 335 | fh.close() |
|
292 | 336 | # start http push |
|
293 | 337 | fp_ = httpconnection.httpsendfile(self.ui, filename, "rb") |
|
294 | 338 | headers = {'Content-Type': 'application/mercurial-0.1'} |
|
295 | 339 | return self._callstream(cmd, data=fp_, headers=headers, **args) |
|
296 | 340 | finally: |
|
297 | 341 | if fp_ is not None: |
|
298 | 342 | fp_.close() |
|
299 | 343 | if fh is not None: |
|
300 | 344 | fh.close() |
|
301 | 345 | os.unlink(filename) |
|
302 | 346 | |
|
303 | 347 | def _callcompressable(self, cmd, **args): |
|
304 | 348 | return self._callstream(cmd, _compressible=True, **args) |
|
305 | 349 | |
|
306 | 350 | def _abort(self, exception): |
|
307 | 351 | raise exception |
|
308 | 352 | |
|
309 | 353 | class httpspeer(httppeer): |
|
310 | 354 | def __init__(self, ui, path): |
|
311 | 355 | if not url.has_https: |
|
312 | 356 | raise error.Abort(_('Python support for SSL and HTTPS ' |
|
313 | 357 | 'is not installed')) |
|
314 | 358 | httppeer.__init__(self, ui, path) |
|
315 | 359 | |
|
316 | 360 | def instance(ui, path, create): |
|
317 | 361 | if create: |
|
318 | 362 | raise error.Abort(_('cannot create new http repository')) |
|
319 | 363 | try: |
|
320 | 364 | if path.startswith('https:'): |
|
321 | 365 | inst = httpspeer(ui, path) |
|
322 | 366 | else: |
|
323 | 367 | inst = httppeer(ui, path) |
|
324 | 368 | try: |
|
325 | 369 | # Try to do useful work when checking compatibility. |
|
326 | 370 | # Usually saves a roundtrip since we want the caps anyway. |
|
327 | 371 | inst._fetchcaps() |
|
328 | 372 | except error.RepoError: |
|
329 | 373 | # No luck, try older compatibility check. |
|
330 | 374 | inst.between([(nullid, nullid)]) |
|
331 | 375 | return inst |
|
332 | 376 | except error.RepoError as httpexception: |
|
333 | 377 | try: |
|
334 | 378 | r = statichttprepo.instance(ui, "static-" + path, create) |
|
335 | 379 | ui.note(_('(falling back to static-http)\n')) |
|
336 | 380 | return r |
|
337 | 381 | except error.RepoError: |
|
338 | 382 | raise httpexception # use the original http RepoError instead |
@@ -1,481 +1,486 b'' | |||
|
1 | 1 | # url.py - HTTP handling for mercurial |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2005, 2006, 2007, 2008 Matt Mackall <mpm@selenic.com> |
|
4 | 4 | # Copyright 2006, 2007 Alexis S. L. Carvalho <alexis@cecm.usp.br> |
|
5 | 5 | # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> |
|
6 | 6 | # |
|
7 | 7 | # This software may be used and distributed according to the terms of the |
|
8 | 8 | # GNU General Public License version 2 or any later version. |
|
9 | 9 | |
|
10 | 10 | from __future__ import absolute_import |
|
11 | 11 | |
|
12 | 12 | import base64 |
|
13 | 13 | import os |
|
14 | 14 | import socket |
|
15 | 15 | |
|
16 | 16 | from .i18n import _ |
|
17 | 17 | from . import ( |
|
18 | 18 | error, |
|
19 | 19 | httpconnection as httpconnectionmod, |
|
20 | 20 | keepalive, |
|
21 | 21 | pycompat, |
|
22 | 22 | sslutil, |
|
23 | 23 | util, |
|
24 | 24 | ) |
|
25 | 25 | |
|
26 | 26 | httplib = util.httplib |
|
27 | 27 | stringio = util.stringio |
|
28 | 28 | urlerr = util.urlerr |
|
29 | 29 | urlreq = util.urlreq |
|
30 | 30 | |
|
31 | 31 | class passwordmgr(object): |
|
32 | 32 | def __init__(self, ui, passwddb): |
|
33 | 33 | self.ui = ui |
|
34 | 34 | self.passwddb = passwddb |
|
35 | 35 | |
|
36 | 36 | def add_password(self, realm, uri, user, passwd): |
|
37 | 37 | return self.passwddb.add_password(realm, uri, user, passwd) |
|
38 | 38 | |
|
39 | 39 | def find_user_password(self, realm, authuri): |
|
40 | 40 | authinfo = self.passwddb.find_user_password(realm, authuri) |
|
41 | 41 | user, passwd = authinfo |
|
42 | 42 | if user and passwd: |
|
43 | 43 | self._writedebug(user, passwd) |
|
44 | 44 | return (user, passwd) |
|
45 | 45 | |
|
46 | 46 | if not user or not passwd: |
|
47 | 47 | res = httpconnectionmod.readauthforuri(self.ui, authuri, user) |
|
48 | 48 | if res: |
|
49 | 49 | group, auth = res |
|
50 | 50 | user, passwd = auth.get('username'), auth.get('password') |
|
51 | 51 | self.ui.debug("using auth.%s.* for authentication\n" % group) |
|
52 | 52 | if not user or not passwd: |
|
53 | 53 | u = util.url(authuri) |
|
54 | 54 | u.query = None |
|
55 | 55 | if not self.ui.interactive(): |
|
56 | 56 | raise error.Abort(_('http authorization required for %s') % |
|
57 | 57 | util.hidepassword(str(u))) |
|
58 | 58 | |
|
59 | 59 | self.ui.write(_("http authorization required for %s\n") % |
|
60 | 60 | util.hidepassword(str(u))) |
|
61 | 61 | self.ui.write(_("realm: %s\n") % realm) |
|
62 | 62 | if user: |
|
63 | 63 | self.ui.write(_("user: %s\n") % user) |
|
64 | 64 | else: |
|
65 | 65 | user = self.ui.prompt(_("user:"), default=None) |
|
66 | 66 | |
|
67 | 67 | if not passwd: |
|
68 | 68 | passwd = self.ui.getpass() |
|
69 | 69 | |
|
70 | 70 | self.passwddb.add_password(realm, authuri, user, passwd) |
|
71 | 71 | self._writedebug(user, passwd) |
|
72 | 72 | return (user, passwd) |
|
73 | 73 | |
|
74 | 74 | def _writedebug(self, user, passwd): |
|
75 | 75 | msg = _('http auth: user %s, password %s\n') |
|
76 | 76 | self.ui.debug(msg % (user, passwd and '*' * len(passwd) or 'not set')) |
|
77 | 77 | |
|
78 | 78 | def find_stored_password(self, authuri): |
|
79 | 79 | return self.passwddb.find_user_password(None, authuri) |
|
80 | 80 | |
|
81 | 81 | class proxyhandler(urlreq.proxyhandler): |
|
82 | 82 | def __init__(self, ui): |
|
83 | 83 | proxyurl = (ui.config("http_proxy", "host") or |
|
84 | 84 | pycompat.osgetenv('http_proxy')) |
|
85 | 85 | # XXX proxyauthinfo = None |
|
86 | 86 | |
|
87 | 87 | if proxyurl: |
|
88 | 88 | # proxy can be proper url or host[:port] |
|
89 | 89 | if not (proxyurl.startswith('http:') or |
|
90 | 90 | proxyurl.startswith('https:')): |
|
91 | 91 | proxyurl = 'http://' + proxyurl + '/' |
|
92 | 92 | proxy = util.url(proxyurl) |
|
93 | 93 | if not proxy.user: |
|
94 | 94 | proxy.user = ui.config("http_proxy", "user") |
|
95 | 95 | proxy.passwd = ui.config("http_proxy", "passwd") |
|
96 | 96 | |
|
97 | 97 | # see if we should use a proxy for this url |
|
98 | 98 | no_list = ["localhost", "127.0.0.1"] |
|
99 | 99 | no_list.extend([p.lower() for |
|
100 | 100 | p in ui.configlist("http_proxy", "no")]) |
|
101 | 101 | no_list.extend([p.strip().lower() for |
|
102 | 102 | p in pycompat.osgetenv("no_proxy", '').split(',') |
|
103 | 103 | if p.strip()]) |
|
104 | 104 | # "http_proxy.always" config is for running tests on localhost |
|
105 | 105 | if ui.configbool("http_proxy", "always"): |
|
106 | 106 | self.no_list = [] |
|
107 | 107 | else: |
|
108 | 108 | self.no_list = no_list |
|
109 | 109 | |
|
110 | 110 | proxyurl = str(proxy) |
|
111 | 111 | proxies = {'http': proxyurl, 'https': proxyurl} |
|
112 | 112 | ui.debug('proxying through http://%s:%s\n' % |
|
113 | 113 | (proxy.host, proxy.port)) |
|
114 | 114 | else: |
|
115 | 115 | proxies = {} |
|
116 | 116 | |
|
117 | 117 | urlreq.proxyhandler.__init__(self, proxies) |
|
118 | 118 | self.ui = ui |
|
119 | 119 | |
|
120 | 120 | def proxy_open(self, req, proxy, type_): |
|
121 | 121 | host = req.get_host().split(':')[0] |
|
122 | 122 | for e in self.no_list: |
|
123 | 123 | if host == e: |
|
124 | 124 | return None |
|
125 | 125 | if e.startswith('*.') and host.endswith(e[2:]): |
|
126 | 126 | return None |
|
127 | 127 | if e.startswith('.') and host.endswith(e[1:]): |
|
128 | 128 | return None |
|
129 | 129 | |
|
130 | 130 | return urlreq.proxyhandler.proxy_open(self, req, proxy, type_) |
|
131 | 131 | |
|
132 | 132 | def _gen_sendfile(orgsend): |
|
133 | 133 | def _sendfile(self, data): |
|
134 | 134 | # send a file |
|
135 | 135 | if isinstance(data, httpconnectionmod.httpsendfile): |
|
136 | 136 | # if auth required, some data sent twice, so rewind here |
|
137 | 137 | data.seek(0) |
|
138 | 138 | for chunk in util.filechunkiter(data): |
|
139 | 139 | orgsend(self, chunk) |
|
140 | 140 | else: |
|
141 | 141 | orgsend(self, data) |
|
142 | 142 | return _sendfile |
|
143 | 143 | |
|
144 | 144 | has_https = util.safehasattr(urlreq, 'httpshandler') |
|
145 | 145 | |
|
146 | 146 | class httpconnection(keepalive.HTTPConnection): |
|
147 | 147 | # must be able to send big bundle as stream. |
|
148 | 148 | send = _gen_sendfile(keepalive.HTTPConnection.send) |
|
149 | 149 | |
|
150 | 150 | def getresponse(self): |
|
151 | 151 | proxyres = getattr(self, 'proxyres', None) |
|
152 | 152 | if proxyres: |
|
153 | 153 | if proxyres.will_close: |
|
154 | 154 | self.close() |
|
155 | 155 | self.proxyres = None |
|
156 | 156 | return proxyres |
|
157 | 157 | return keepalive.HTTPConnection.getresponse(self) |
|
158 | 158 | |
|
159 | 159 | # general transaction handler to support different ways to handle |
|
160 | 160 | # HTTPS proxying before and after Python 2.6.3. |
|
161 | 161 | def _generic_start_transaction(handler, h, req): |
|
162 | 162 | tunnel_host = getattr(req, '_tunnel_host', None) |
|
163 | 163 | if tunnel_host: |
|
164 | 164 | if tunnel_host[:7] not in ['http://', 'https:/']: |
|
165 | 165 | tunnel_host = 'https://' + tunnel_host |
|
166 | 166 | new_tunnel = True |
|
167 | 167 | else: |
|
168 | 168 | tunnel_host = req.get_selector() |
|
169 | 169 | new_tunnel = False |
|
170 | 170 | |
|
171 | 171 | if new_tunnel or tunnel_host == req.get_full_url(): # has proxy |
|
172 | 172 | u = util.url(tunnel_host) |
|
173 | 173 | if new_tunnel or u.scheme == 'https': # only use CONNECT for HTTPS |
|
174 | 174 | h.realhostport = ':'.join([u.host, (u.port or '443')]) |
|
175 | 175 | h.headers = req.headers.copy() |
|
176 | 176 | h.headers.update(handler.parent.addheaders) |
|
177 | 177 | return |
|
178 | 178 | |
|
179 | 179 | h.realhostport = None |
|
180 | 180 | h.headers = None |
|
181 | 181 | |
|
182 | 182 | def _generic_proxytunnel(self): |
|
183 | 183 | proxyheaders = dict( |
|
184 | 184 | [(x, self.headers[x]) for x in self.headers |
|
185 | 185 | if x.lower().startswith('proxy-')]) |
|
186 | 186 | self.send('CONNECT %s HTTP/1.0\r\n' % self.realhostport) |
|
187 | 187 | for header in proxyheaders.iteritems(): |
|
188 | 188 | self.send('%s: %s\r\n' % header) |
|
189 | 189 | self.send('\r\n') |
|
190 | 190 | |
|
191 | 191 | # majority of the following code is duplicated from |
|
192 | 192 | # httplib.HTTPConnection as there are no adequate places to |
|
193 | 193 | # override functions to provide the needed functionality |
|
194 | 194 | res = self.response_class(self.sock, |
|
195 | 195 | strict=self.strict, |
|
196 | 196 | method=self._method) |
|
197 | 197 | |
|
198 | 198 | while True: |
|
199 | 199 | version, status, reason = res._read_status() |
|
200 | 200 | if status != httplib.CONTINUE: |
|
201 | 201 | break |
|
202 | 202 | # skip lines that are all whitespace |
|
203 | 203 | list(iter(lambda: res.fp.readline().strip(), '')) |
|
204 | 204 | res.status = status |
|
205 | 205 | res.reason = reason.strip() |
|
206 | 206 | |
|
207 | 207 | if res.status == 200: |
|
208 | 208 | # skip lines until we find a blank line |
|
209 | 209 | list(iter(res.fp.readline, '\r\n')) |
|
210 | 210 | return True |
|
211 | 211 | |
|
212 | 212 | if version == 'HTTP/1.0': |
|
213 | 213 | res.version = 10 |
|
214 | 214 | elif version.startswith('HTTP/1.'): |
|
215 | 215 | res.version = 11 |
|
216 | 216 | elif version == 'HTTP/0.9': |
|
217 | 217 | res.version = 9 |
|
218 | 218 | else: |
|
219 | 219 | raise httplib.UnknownProtocol(version) |
|
220 | 220 | |
|
221 | 221 | if res.version == 9: |
|
222 | 222 | res.length = None |
|
223 | 223 | res.chunked = 0 |
|
224 | 224 | res.will_close = 1 |
|
225 | 225 | res.msg = httplib.HTTPMessage(stringio()) |
|
226 | 226 | return False |
|
227 | 227 | |
|
228 | 228 | res.msg = httplib.HTTPMessage(res.fp) |
|
229 | 229 | res.msg.fp = None |
|
230 | 230 | |
|
231 | 231 | # are we using the chunked-style of transfer encoding? |
|
232 | 232 | trenc = res.msg.getheader('transfer-encoding') |
|
233 | 233 | if trenc and trenc.lower() == "chunked": |
|
234 | 234 | res.chunked = 1 |
|
235 | 235 | res.chunk_left = None |
|
236 | 236 | else: |
|
237 | 237 | res.chunked = 0 |
|
238 | 238 | |
|
239 | 239 | # will the connection close at the end of the response? |
|
240 | 240 | res.will_close = res._check_close() |
|
241 | 241 | |
|
242 | 242 | # do we have a Content-Length? |
|
243 | 243 | # NOTE: RFC 2616, section 4.4, #3 says we ignore this if |
|
244 | 244 | # transfer-encoding is "chunked" |
|
245 | 245 | length = res.msg.getheader('content-length') |
|
246 | 246 | if length and not res.chunked: |
|
247 | 247 | try: |
|
248 | 248 | res.length = int(length) |
|
249 | 249 | except ValueError: |
|
250 | 250 | res.length = None |
|
251 | 251 | else: |
|
252 | 252 | if res.length < 0: # ignore nonsensical negative lengths |
|
253 | 253 | res.length = None |
|
254 | 254 | else: |
|
255 | 255 | res.length = None |
|
256 | 256 | |
|
257 | 257 | # does the body have a fixed length? (of zero) |
|
258 | 258 | if (status == httplib.NO_CONTENT or status == httplib.NOT_MODIFIED or |
|
259 | 259 | 100 <= status < 200 or # 1xx codes |
|
260 | 260 | res._method == 'HEAD'): |
|
261 | 261 | res.length = 0 |
|
262 | 262 | |
|
263 | 263 | # if the connection remains open, and we aren't using chunked, and |
|
264 | 264 | # a content-length was not provided, then assume that the connection |
|
265 | 265 | # WILL close. |
|
266 | 266 | if (not res.will_close and |
|
267 | 267 | not res.chunked and |
|
268 | 268 | res.length is None): |
|
269 | 269 | res.will_close = 1 |
|
270 | 270 | |
|
271 | 271 | self.proxyres = res |
|
272 | 272 | |
|
273 | 273 | return False |
|
274 | 274 | |
|
275 | 275 | class httphandler(keepalive.HTTPHandler): |
|
276 | 276 | def http_open(self, req): |
|
277 | 277 | return self.do_open(httpconnection, req) |
|
278 | 278 | |
|
279 | 279 | def _start_transaction(self, h, req): |
|
280 | 280 | _generic_start_transaction(self, h, req) |
|
281 | 281 | return keepalive.HTTPHandler._start_transaction(self, h, req) |
|
282 | 282 | |
|
283 | 283 | if has_https: |
|
284 | 284 | class httpsconnection(httplib.HTTPConnection): |
|
285 | 285 | response_class = keepalive.HTTPResponse |
|
286 | 286 | default_port = httplib.HTTPS_PORT |
|
287 | 287 | # must be able to send big bundle as stream. |
|
288 | 288 | send = _gen_sendfile(keepalive.safesend) |
|
289 | 289 | getresponse = keepalive.wrapgetresponse(httplib.HTTPConnection) |
|
290 | 290 | |
|
291 | 291 | def __init__(self, host, port=None, key_file=None, cert_file=None, |
|
292 | 292 | *args, **kwargs): |
|
293 | 293 | httplib.HTTPConnection.__init__(self, host, port, *args, **kwargs) |
|
294 | 294 | self.key_file = key_file |
|
295 | 295 | self.cert_file = cert_file |
|
296 | 296 | |
|
297 | 297 | def connect(self): |
|
298 | 298 | self.sock = socket.create_connection((self.host, self.port)) |
|
299 | 299 | |
|
300 | 300 | host = self.host |
|
301 | 301 | if self.realhostport: # use CONNECT proxy |
|
302 | 302 | _generic_proxytunnel(self) |
|
303 | 303 | host = self.realhostport.rsplit(':', 1)[0] |
|
304 | 304 | self.sock = sslutil.wrapsocket( |
|
305 | 305 | self.sock, self.key_file, self.cert_file, ui=self.ui, |
|
306 | 306 | serverhostname=host) |
|
307 | 307 | sslutil.validatesocket(self.sock) |
|
308 | 308 | |
|
309 | 309 | class httpshandler(keepalive.KeepAliveHandler, urlreq.httpshandler): |
|
310 | 310 | def __init__(self, ui): |
|
311 | 311 | keepalive.KeepAliveHandler.__init__(self) |
|
312 | 312 | urlreq.httpshandler.__init__(self) |
|
313 | 313 | self.ui = ui |
|
314 | 314 | self.pwmgr = passwordmgr(self.ui, |
|
315 | 315 | self.ui.httppasswordmgrdb) |
|
316 | 316 | |
|
317 | 317 | def _start_transaction(self, h, req): |
|
318 | 318 | _generic_start_transaction(self, h, req) |
|
319 | 319 | return keepalive.KeepAliveHandler._start_transaction(self, h, req) |
|
320 | 320 | |
|
321 | 321 | def https_open(self, req): |
|
322 | 322 | # req.get_full_url() does not contain credentials and we may |
|
323 | 323 | # need them to match the certificates. |
|
324 | 324 | url = req.get_full_url() |
|
325 | 325 | user, password = self.pwmgr.find_stored_password(url) |
|
326 | 326 | res = httpconnectionmod.readauthforuri(self.ui, url, user) |
|
327 | 327 | if res: |
|
328 | 328 | group, auth = res |
|
329 | 329 | self.auth = auth |
|
330 | 330 | self.ui.debug("using auth.%s.* for authentication\n" % group) |
|
331 | 331 | else: |
|
332 | 332 | self.auth = None |
|
333 | 333 | return self.do_open(self._makeconnection, req) |
|
334 | 334 | |
|
335 | 335 | def _makeconnection(self, host, port=None, *args, **kwargs): |
|
336 | 336 | keyfile = None |
|
337 | 337 | certfile = None |
|
338 | 338 | |
|
339 | 339 | if len(args) >= 1: # key_file |
|
340 | 340 | keyfile = args[0] |
|
341 | 341 | if len(args) >= 2: # cert_file |
|
342 | 342 | certfile = args[1] |
|
343 | 343 | args = args[2:] |
|
344 | 344 | |
|
345 | 345 | # if the user has specified different key/cert files in |
|
346 | 346 | # hgrc, we prefer these |
|
347 | 347 | if self.auth and 'key' in self.auth and 'cert' in self.auth: |
|
348 | 348 | keyfile = self.auth['key'] |
|
349 | 349 | certfile = self.auth['cert'] |
|
350 | 350 | |
|
351 | 351 | conn = httpsconnection(host, port, keyfile, certfile, *args, |
|
352 | 352 | **kwargs) |
|
353 | 353 | conn.ui = self.ui |
|
354 | 354 | return conn |
|
355 | 355 | |
|
356 | 356 | class httpdigestauthhandler(urlreq.httpdigestauthhandler): |
|
357 | 357 | def __init__(self, *args, **kwargs): |
|
358 | 358 | urlreq.httpdigestauthhandler.__init__(self, *args, **kwargs) |
|
359 | 359 | self.retried_req = None |
|
360 | 360 | |
|
361 | 361 | def reset_retry_count(self): |
|
362 | 362 | # Python 2.6.5 will call this on 401 or 407 errors and thus loop |
|
363 | 363 | # forever. We disable reset_retry_count completely and reset in |
|
364 | 364 | # http_error_auth_reqed instead. |
|
365 | 365 | pass |
|
366 | 366 | |
|
367 | 367 | def http_error_auth_reqed(self, auth_header, host, req, headers): |
|
368 | 368 | # Reset the retry counter once for each request. |
|
369 | 369 | if req is not self.retried_req: |
|
370 | 370 | self.retried_req = req |
|
371 | 371 | self.retried = 0 |
|
372 | 372 | return urlreq.httpdigestauthhandler.http_error_auth_reqed( |
|
373 | 373 | self, auth_header, host, req, headers) |
|
374 | 374 | |
|
375 | 375 | class httpbasicauthhandler(urlreq.httpbasicauthhandler): |
|
376 | 376 | def __init__(self, *args, **kwargs): |
|
377 | 377 | self.auth = None |
|
378 | 378 | urlreq.httpbasicauthhandler.__init__(self, *args, **kwargs) |
|
379 | 379 | self.retried_req = None |
|
380 | 380 | |
|
381 | 381 | def http_request(self, request): |
|
382 | 382 | if self.auth: |
|
383 | 383 | request.add_unredirected_header(self.auth_header, self.auth) |
|
384 | 384 | |
|
385 | 385 | return request |
|
386 | 386 | |
|
387 | 387 | def https_request(self, request): |
|
388 | 388 | if self.auth: |
|
389 | 389 | request.add_unredirected_header(self.auth_header, self.auth) |
|
390 | 390 | |
|
391 | 391 | return request |
|
392 | 392 | |
|
393 | 393 | def reset_retry_count(self): |
|
394 | 394 | # Python 2.6.5 will call this on 401 or 407 errors and thus loop |
|
395 | 395 | # forever. We disable reset_retry_count completely and reset in |
|
396 | 396 | # http_error_auth_reqed instead. |
|
397 | 397 | pass |
|
398 | 398 | |
|
399 | 399 | def http_error_auth_reqed(self, auth_header, host, req, headers): |
|
400 | 400 | # Reset the retry counter once for each request. |
|
401 | 401 | if req is not self.retried_req: |
|
402 | 402 | self.retried_req = req |
|
403 | 403 | self.retried = 0 |
|
404 | 404 | return urlreq.httpbasicauthhandler.http_error_auth_reqed( |
|
405 | 405 | self, auth_header, host, req, headers) |
|
406 | 406 | |
|
407 | 407 | def retry_http_basic_auth(self, host, req, realm): |
|
408 | 408 | user, pw = self.passwd.find_user_password(realm, req.get_full_url()) |
|
409 | 409 | if pw is not None: |
|
410 | 410 | raw = "%s:%s" % (user, pw) |
|
411 | 411 | auth = 'Basic %s' % base64.b64encode(raw).strip() |
|
412 | 412 | if req.get_header(self.auth_header, None) == auth: |
|
413 | 413 | return None |
|
414 | 414 | self.auth = auth |
|
415 | 415 | req.add_unredirected_header(self.auth_header, auth) |
|
416 | 416 | return self.parent.open(req) |
|
417 | 417 | else: |
|
418 | 418 | return None |
|
419 | 419 | |
|
420 | 420 | handlerfuncs = [] |
|
421 | 421 | |
|
422 | 422 | def opener(ui, authinfo=None): |
|
423 | 423 | ''' |
|
424 | 424 | construct an opener suitable for urllib2 |
|
425 | 425 | authinfo will be added to the password manager |
|
426 | 426 | ''' |
|
427 | 427 | # experimental config: ui.usehttp2 |
|
428 | 428 | if ui.configbool('ui', 'usehttp2', False): |
|
429 | 429 | handlers = [ |
|
430 | 430 | httpconnectionmod.http2handler( |
|
431 | 431 | ui, |
|
432 | 432 | passwordmgr(ui, ui.httppasswordmgrdb)) |
|
433 | 433 | ] |
|
434 | 434 | else: |
|
435 | 435 | handlers = [httphandler()] |
|
436 | 436 | if has_https: |
|
437 | 437 | handlers.append(httpshandler(ui)) |
|
438 | 438 | |
|
439 | 439 | handlers.append(proxyhandler(ui)) |
|
440 | 440 | |
|
441 | 441 | passmgr = passwordmgr(ui, ui.httppasswordmgrdb) |
|
442 | 442 | if authinfo is not None: |
|
443 | 443 | realm, uris, user, passwd = authinfo |
|
444 | 444 | saveduser, savedpass = passmgr.find_stored_password(uris[0]) |
|
445 | 445 | if user != saveduser or passwd: |
|
446 | 446 | passmgr.add_password(realm, uris, user, passwd) |
|
447 | 447 | ui.debug('http auth: user %s, password %s\n' % |
|
448 | 448 | (user, passwd and '*' * len(passwd) or 'not set')) |
|
449 | 449 | |
|
450 | 450 | handlers.extend((httpbasicauthhandler(passmgr), |
|
451 | 451 | httpdigestauthhandler(passmgr))) |
|
452 | 452 | handlers.extend([h(ui, passmgr) for h in handlerfuncs]) |
|
453 | 453 | opener = urlreq.buildopener(*handlers) |
|
454 | 454 | |
|
455 | 455 | # The user agent should should *NOT* be used by servers for e.g. |
|
456 | 456 | # protocol detection or feature negotiation: there are other |
|
457 | 457 | # facilities for that. |
|
458 | 458 | # |
|
459 | 459 | # "mercurial/proto-1.0" was the original user agent string and |
|
460 | 460 | # exists for backwards compatibility reasons. |
|
461 | 461 | # |
|
462 | 462 | # The "(Mercurial %s)" string contains the distribution |
|
463 | 463 | # name and version. Other client implementations should choose their |
|
464 | 464 | # own distribution name. Since servers should not be using the user |
|
465 | 465 | # agent string for anything, clients should be able to define whatever |
|
466 | 466 | # user agent they deem appropriate. |
|
467 | 467 | agent = 'mercurial/proto-1.0 (Mercurial %s)' % util.version() |
|
468 | 468 | opener.addheaders = [('User-agent', agent)] |
|
469 | ||
|
470 | # This header should only be needed by wire protocol requests. But it has | |
|
471 | # been sent on all requests since forever. We keep sending it for backwards | |
|
472 | # compatibility reasons. Modern versions of the wire protocol use | |
|
473 | # X-HgProto-<N> for advertising client support. | |
|
469 | 474 | opener.addheaders.append(('Accept', 'application/mercurial-0.1')) |
|
470 | 475 | return opener |
|
471 | 476 | |
|
472 | 477 | def open(ui, url_, data=None): |
|
473 | 478 | u = util.url(url_) |
|
474 | 479 | if u.scheme: |
|
475 | 480 | u.scheme = u.scheme.lower() |
|
476 | 481 | url_, authinfo = u.authinfo() |
|
477 | 482 | else: |
|
478 | 483 | path = util.normpath(os.path.abspath(url_)) |
|
479 | 484 | url_ = 'file://' + urlreq.pathname2url(path) |
|
480 | 485 | authinfo = None |
|
481 | 486 | return opener(ui, authinfo).open(url_, data) |
@@ -1,432 +1,432 b'' | |||
|
1 | 1 | Set up a server |
|
2 | 2 | |
|
3 | 3 | $ cat >> $HGRCPATH << EOF |
|
4 | 4 | > [format] |
|
5 | 5 | > usegeneraldelta=yes |
|
6 | 6 | > EOF |
|
7 | 7 | $ hg init server |
|
8 | 8 | $ cd server |
|
9 | 9 | $ cat >> .hg/hgrc << EOF |
|
10 | 10 | > [extensions] |
|
11 | 11 | > clonebundles = |
|
12 | 12 | > EOF |
|
13 | 13 | |
|
14 | 14 | $ touch foo |
|
15 | 15 | $ hg -q commit -A -m 'add foo' |
|
16 | 16 | $ touch bar |
|
17 | 17 | $ hg -q commit -A -m 'add bar' |
|
18 | 18 | |
|
19 | 19 | $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log |
|
20 | 20 | $ cat hg.pid >> $DAEMON_PIDS |
|
21 | 21 | $ cd .. |
|
22 | 22 | |
|
23 | 23 | Missing manifest should not result in server lookup |
|
24 | 24 | |
|
25 | 25 | $ hg --verbose clone -U http://localhost:$HGPORT no-manifest |
|
26 | 26 | requesting all changes |
|
27 | 27 | adding changesets |
|
28 | 28 | adding manifests |
|
29 | 29 | adding file changes |
|
30 | 30 | added 2 changesets with 2 changes to 2 files |
|
31 | 31 | |
|
32 | 32 | $ cat server/access.log |
|
33 | 33 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
34 | * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) | |
|
35 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phases%2Cbookmarks (glob) | |
|
34 | * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
35 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
36 | 36 | |
|
37 | 37 | Empty manifest file results in retrieval |
|
38 | 38 | (the extension only checks if the manifest file exists) |
|
39 | 39 | |
|
40 | 40 | $ touch server/.hg/clonebundles.manifest |
|
41 | 41 | $ hg --verbose clone -U http://localhost:$HGPORT empty-manifest |
|
42 | 42 | no clone bundles available on remote; falling back to regular clone |
|
43 | 43 | requesting all changes |
|
44 | 44 | adding changesets |
|
45 | 45 | adding manifests |
|
46 | 46 | adding file changes |
|
47 | 47 | added 2 changesets with 2 changes to 2 files |
|
48 | 48 | |
|
49 | 49 | Manifest file with invalid URL aborts |
|
50 | 50 | |
|
51 | 51 | $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest |
|
52 | 52 | $ hg clone http://localhost:$HGPORT 404-url |
|
53 | 53 | applying clone bundle from http://does.not.exist/bundle.hg |
|
54 | 54 | error fetching bundle: (.* not known|getaddrinfo failed|No address associated with hostname) (re) |
|
55 | 55 | abort: error applying bundle |
|
56 | 56 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false") |
|
57 | 57 | [255] |
|
58 | 58 | |
|
59 | 59 | Server is not running aborts |
|
60 | 60 | |
|
61 | 61 | $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest |
|
62 | 62 | $ hg clone http://localhost:$HGPORT server-not-runner |
|
63 | 63 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg |
|
64 | 64 | error fetching bundle: (.* refused.*|Protocol not supported) (re) |
|
65 | 65 | abort: error applying bundle |
|
66 | 66 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false") |
|
67 | 67 | [255] |
|
68 | 68 | |
|
69 | 69 | Server returns 404 |
|
70 | 70 | |
|
71 | 71 | $ python $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid |
|
72 | 72 | $ cat http.pid >> $DAEMON_PIDS |
|
73 | 73 | $ hg clone http://localhost:$HGPORT running-404 |
|
74 | 74 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg |
|
75 | 75 | HTTP error fetching bundle: HTTP Error 404: File not found |
|
76 | 76 | abort: error applying bundle |
|
77 | 77 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false") |
|
78 | 78 | [255] |
|
79 | 79 | |
|
80 | 80 | We can override failure to fall back to regular clone |
|
81 | 81 | |
|
82 | 82 | $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback |
|
83 | 83 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg |
|
84 | 84 | HTTP error fetching bundle: HTTP Error 404: File not found |
|
85 | 85 | falling back to normal clone |
|
86 | 86 | requesting all changes |
|
87 | 87 | adding changesets |
|
88 | 88 | adding manifests |
|
89 | 89 | adding file changes |
|
90 | 90 | added 2 changesets with 2 changes to 2 files |
|
91 | 91 | |
|
92 | 92 | Bundle with partial content works |
|
93 | 93 | |
|
94 | 94 | $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg |
|
95 | 95 | 1 changesets found |
|
96 | 96 | |
|
97 | 97 | We verify exact bundle content as an extra check against accidental future |
|
98 | 98 | changes. If this output changes, we could break old clients. |
|
99 | 99 | |
|
100 | 100 | $ f --size --hexdump partial.hg |
|
101 | 101 | partial.hg: size=207 |
|
102 | 102 | 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....| |
|
103 | 103 | 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!| |
|
104 | 104 | 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.| |
|
105 | 105 | 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2| |
|
106 | 106 | 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...| |
|
107 | 107 | 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1| |
|
108 | 108 | 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...| |
|
109 | 109 | 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u| |
|
110 | 110 | 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.| |
|
111 | 111 | 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$| |
|
112 | 112 | 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.| |
|
113 | 113 | 00b0: 16 b2 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..| |
|
114 | 114 | 00c0: 78 ed fc d5 76 f1 36 35 dc 05 00 36 ed 5e c7 |x...v.65...6.^.| |
|
115 | 115 | |
|
116 | 116 | $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest |
|
117 | 117 | $ hg clone -U http://localhost:$HGPORT partial-bundle |
|
118 | 118 | applying clone bundle from http://localhost:$HGPORT1/partial.hg |
|
119 | 119 | adding changesets |
|
120 | 120 | adding manifests |
|
121 | 121 | adding file changes |
|
122 | 122 | added 1 changesets with 1 changes to 1 files |
|
123 | 123 | finished applying clone bundle |
|
124 | 124 | searching for changes |
|
125 | 125 | adding changesets |
|
126 | 126 | adding manifests |
|
127 | 127 | adding file changes |
|
128 | 128 | added 1 changesets with 1 changes to 1 files |
|
129 | 129 | |
|
130 | 130 | Incremental pull doesn't fetch bundle |
|
131 | 131 | |
|
132 | 132 | $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone |
|
133 | 133 | adding changesets |
|
134 | 134 | adding manifests |
|
135 | 135 | adding file changes |
|
136 | 136 | added 1 changesets with 1 changes to 1 files |
|
137 | 137 | |
|
138 | 138 | $ cd partial-clone |
|
139 | 139 | $ hg pull |
|
140 | 140 | pulling from http://localhost:$HGPORT/ |
|
141 | 141 | searching for changes |
|
142 | 142 | adding changesets |
|
143 | 143 | adding manifests |
|
144 | 144 | adding file changes |
|
145 | 145 | added 1 changesets with 1 changes to 1 files |
|
146 | 146 | (run 'hg update' to get a working copy) |
|
147 | 147 | $ cd .. |
|
148 | 148 | |
|
149 | 149 | Bundle with full content works |
|
150 | 150 | |
|
151 | 151 | $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg |
|
152 | 152 | 2 changesets found |
|
153 | 153 | |
|
154 | 154 | Again, we perform an extra check against bundle content changes. If this content |
|
155 | 155 | changes, clone bundles produced by new Mercurial versions may not be readable |
|
156 | 156 | by old clients. |
|
157 | 157 | |
|
158 | 158 | $ f --size --hexdump full.hg |
|
159 | 159 | full.hg: size=396 |
|
160 | 160 | 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress| |
|
161 | 161 | 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 d0 e4 76 f6 70 |ion=GZx.c``..v.p| |
|
162 | 162 | 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 46 76 26 4e |.swu....`..FFv&N| |
|
163 | 163 | 0030: c6 b2 d4 a2 e2 cc fc 3c 03 a3 bc a4 e4 8c c4 bc |.......<........| |
|
164 | 164 | 0040: f4 d4 62 23 06 06 e6 19 40 f9 4d c1 2a 31 09 cf |..b#....@.M.*1..| |
|
165 | 165 | 0050: 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 97 17 b2 c9 |.:R.............| |
|
166 | 166 | 0060: 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 a4 a4 1a 5b |.......%.......[| |
|
167 | 167 | 0070: 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 a4 59 26 5a |X..'..Y..Y...Y&Z| |
|
168 | 168 | 0080: 18 9a 18 59 5a 26 1a 27 27 25 99 a6 99 1a 70 95 |...YZ&.''%....p.| |
|
169 | 169 | 0090: a4 16 97 70 19 28 18 70 a5 e5 e7 73 71 25 a6 a4 |...p.(.p...sq%..| |
|
170 | 170 | 00a0: 28 00 19 20 17 af fa df ab ff 7b 3f fb 92 dc 8b |(.. ......{?....| |
|
171 | 171 | 00b0: 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 89 2f b0 99 87 |.b......=ZD./...| |
|
172 | 172 | 00c0: ec e2 54 63 43 e3 b4 64 43 73 23 33 43 53 0b 63 |..TcC..dCs#3CS.c| |
|
173 | 173 | 00d0: d3 14 23 03 a0 fb 2c 2c 0c d3 80 1e 30 49 49 b1 |..#...,,....0II.| |
|
174 | 174 | 00e0: 4c 4a 32 48 33 30 b0 34 42 b8 38 29 b1 08 e2 62 |LJ2H30.4B.8)...b| |
|
175 | 175 | 00f0: 20 03 6a ca c2 2c db 2f f7 2c fa 6d fc fb 34 be | .j..,./.,.m..4.| |
|
176 | 176 | 0100: fc 5c 21 a2 39 cb 66 77 7c 00 0d c3 59 17 14 58 |.\!.9.fw|...Y..X| |
|
177 | 177 | 0110: 49 16 06 29 a9 a6 29 86 c6 16 e6 a6 16 a6 26 86 |I..)..).......&.| |
|
178 | 178 | 0120: c9 a6 69 06 a6 46 66 a6 89 29 86 26 26 89 49 96 |..i..Ff..).&&.I.| |
|
179 | 179 | 0130: 69 89 16 66 29 86 29 49 5c 20 07 3e 16 fe 23 ae |i..f).)I\ .>..#.| |
|
180 | 180 | 0140: 26 da 1c ab 10 1f d1 f8 e3 b3 ef cd dd fc 0c 93 |&...............| |
|
181 | 181 | 0150: 88 75 34 36 75 04 82 55 17 14 36 a4 38 10 04 d8 |.u46u..U..6.8...| |
|
182 | 182 | 0160: 21 01 9a b1 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 |!......E..V....R| |
|
183 | 183 | 0170: d7 8a 78 ed fc d5 76 f1 36 25 81 89 c7 ad ec 90 |..x...v.6%......| |
|
184 | 184 | 0180: 54 47 75 2b 89 49 b1 00 d2 8a eb 92 |TGu+.I......| |
|
185 | 185 | |
|
186 | 186 | $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest |
|
187 | 187 | $ hg clone -U http://localhost:$HGPORT full-bundle |
|
188 | 188 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
189 | 189 | adding changesets |
|
190 | 190 | adding manifests |
|
191 | 191 | adding file changes |
|
192 | 192 | added 2 changesets with 2 changes to 2 files |
|
193 | 193 | finished applying clone bundle |
|
194 | 194 | searching for changes |
|
195 | 195 | no changes found |
|
196 | 196 | |
|
197 | 197 | Feature works over SSH |
|
198 | 198 | |
|
199 | 199 | $ hg clone -U -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/server ssh-full-clone |
|
200 | 200 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
201 | 201 | adding changesets |
|
202 | 202 | adding manifests |
|
203 | 203 | adding file changes |
|
204 | 204 | added 2 changesets with 2 changes to 2 files |
|
205 | 205 | finished applying clone bundle |
|
206 | 206 | searching for changes |
|
207 | 207 | no changes found |
|
208 | 208 | |
|
209 | 209 | Entry with unknown BUNDLESPEC is filtered and not used |
|
210 | 210 | |
|
211 | 211 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
212 | 212 | > http://bad.entry1 BUNDLESPEC=UNKNOWN |
|
213 | 213 | > http://bad.entry2 BUNDLESPEC=xz-v1 |
|
214 | 214 | > http://bad.entry3 BUNDLESPEC=none-v100 |
|
215 | 215 | > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2 |
|
216 | 216 | > EOF |
|
217 | 217 | |
|
218 | 218 | $ hg clone -U http://localhost:$HGPORT filter-unknown-type |
|
219 | 219 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
220 | 220 | adding changesets |
|
221 | 221 | adding manifests |
|
222 | 222 | adding file changes |
|
223 | 223 | added 2 changesets with 2 changes to 2 files |
|
224 | 224 | finished applying clone bundle |
|
225 | 225 | searching for changes |
|
226 | 226 | no changes found |
|
227 | 227 | |
|
228 | 228 | Automatic fallback when all entries are filtered |
|
229 | 229 | |
|
230 | 230 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
231 | 231 | > http://bad.entry BUNDLESPEC=UNKNOWN |
|
232 | 232 | > EOF |
|
233 | 233 | |
|
234 | 234 | $ hg clone -U http://localhost:$HGPORT filter-all |
|
235 | 235 | no compatible clone bundles available on server; falling back to regular clone |
|
236 | 236 | (you may want to report this to the server operator) |
|
237 | 237 | requesting all changes |
|
238 | 238 | adding changesets |
|
239 | 239 | adding manifests |
|
240 | 240 | adding file changes |
|
241 | 241 | added 2 changesets with 2 changes to 2 files |
|
242 | 242 | |
|
243 | 243 | URLs requiring SNI are filtered in Python <2.7.9 |
|
244 | 244 | |
|
245 | 245 | $ cp full.hg sni.hg |
|
246 | 246 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
247 | 247 | > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true |
|
248 | 248 | > http://localhost:$HGPORT1/full.hg |
|
249 | 249 | > EOF |
|
250 | 250 | |
|
251 | 251 | #if sslcontext |
|
252 | 252 | Python 2.7.9+ support SNI |
|
253 | 253 | |
|
254 | 254 | $ hg clone -U http://localhost:$HGPORT sni-supported |
|
255 | 255 | applying clone bundle from http://localhost:$HGPORT1/sni.hg |
|
256 | 256 | adding changesets |
|
257 | 257 | adding manifests |
|
258 | 258 | adding file changes |
|
259 | 259 | added 2 changesets with 2 changes to 2 files |
|
260 | 260 | finished applying clone bundle |
|
261 | 261 | searching for changes |
|
262 | 262 | no changes found |
|
263 | 263 | #else |
|
264 | 264 | Python <2.7.9 will filter SNI URLs |
|
265 | 265 | |
|
266 | 266 | $ hg clone -U http://localhost:$HGPORT sni-unsupported |
|
267 | 267 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
268 | 268 | adding changesets |
|
269 | 269 | adding manifests |
|
270 | 270 | adding file changes |
|
271 | 271 | added 2 changesets with 2 changes to 2 files |
|
272 | 272 | finished applying clone bundle |
|
273 | 273 | searching for changes |
|
274 | 274 | no changes found |
|
275 | 275 | #endif |
|
276 | 276 | |
|
277 | 277 | Stream clone bundles are supported |
|
278 | 278 | |
|
279 | 279 | $ hg -R server debugcreatestreamclonebundle packed.hg |
|
280 | 280 | writing 613 bytes for 4 files |
|
281 | 281 | bundle requirements: generaldelta, revlogv1 |
|
282 | 282 | |
|
283 | 283 | No bundle spec should work |
|
284 | 284 | |
|
285 | 285 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
286 | 286 | > http://localhost:$HGPORT1/packed.hg |
|
287 | 287 | > EOF |
|
288 | 288 | |
|
289 | 289 | $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec |
|
290 | 290 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
291 | 291 | 4 files to transfer, 613 bytes of data |
|
292 | 292 | transferred 613 bytes in *.* seconds (*) (glob) |
|
293 | 293 | finished applying clone bundle |
|
294 | 294 | searching for changes |
|
295 | 295 | no changes found |
|
296 | 296 | |
|
297 | 297 | Bundle spec without parameters should work |
|
298 | 298 | |
|
299 | 299 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
300 | 300 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1 |
|
301 | 301 | > EOF |
|
302 | 302 | |
|
303 | 303 | $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec |
|
304 | 304 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
305 | 305 | 4 files to transfer, 613 bytes of data |
|
306 | 306 | transferred 613 bytes in *.* seconds (*) (glob) |
|
307 | 307 | finished applying clone bundle |
|
308 | 308 | searching for changes |
|
309 | 309 | no changes found |
|
310 | 310 | |
|
311 | 311 | Bundle spec with format requirements should work |
|
312 | 312 | |
|
313 | 313 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
314 | 314 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1 |
|
315 | 315 | > EOF |
|
316 | 316 | |
|
317 | 317 | $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements |
|
318 | 318 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
319 | 319 | 4 files to transfer, 613 bytes of data |
|
320 | 320 | transferred 613 bytes in *.* seconds (*) (glob) |
|
321 | 321 | finished applying clone bundle |
|
322 | 322 | searching for changes |
|
323 | 323 | no changes found |
|
324 | 324 | |
|
325 | 325 | Stream bundle spec with unknown requirements should be filtered out |
|
326 | 326 | |
|
327 | 327 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
328 | 328 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42 |
|
329 | 329 | > EOF |
|
330 | 330 | |
|
331 | 331 | $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements |
|
332 | 332 | no compatible clone bundles available on server; falling back to regular clone |
|
333 | 333 | (you may want to report this to the server operator) |
|
334 | 334 | requesting all changes |
|
335 | 335 | adding changesets |
|
336 | 336 | adding manifests |
|
337 | 337 | adding file changes |
|
338 | 338 | added 2 changesets with 2 changes to 2 files |
|
339 | 339 | |
|
340 | 340 | Set up manifest for testing preferences |
|
341 | 341 | (Remember, the TYPE does not have to match reality - the URL is |
|
342 | 342 | important) |
|
343 | 343 | |
|
344 | 344 | $ cp full.hg gz-a.hg |
|
345 | 345 | $ cp full.hg gz-b.hg |
|
346 | 346 | $ cp full.hg bz2-a.hg |
|
347 | 347 | $ cp full.hg bz2-b.hg |
|
348 | 348 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
349 | 349 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a |
|
350 | 350 | > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a |
|
351 | 351 | > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b |
|
352 | 352 | > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b |
|
353 | 353 | > EOF |
|
354 | 354 | |
|
355 | 355 | Preferring an undefined attribute will take first entry |
|
356 | 356 | |
|
357 | 357 | $ hg --config ui.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo |
|
358 | 358 | applying clone bundle from http://localhost:$HGPORT1/gz-a.hg |
|
359 | 359 | adding changesets |
|
360 | 360 | adding manifests |
|
361 | 361 | adding file changes |
|
362 | 362 | added 2 changesets with 2 changes to 2 files |
|
363 | 363 | finished applying clone bundle |
|
364 | 364 | searching for changes |
|
365 | 365 | no changes found |
|
366 | 366 | |
|
367 | 367 | Preferring bz2 type will download first entry of that type |
|
368 | 368 | |
|
369 | 369 | $ hg --config ui.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz |
|
370 | 370 | applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg |
|
371 | 371 | adding changesets |
|
372 | 372 | adding manifests |
|
373 | 373 | adding file changes |
|
374 | 374 | added 2 changesets with 2 changes to 2 files |
|
375 | 375 | finished applying clone bundle |
|
376 | 376 | searching for changes |
|
377 | 377 | no changes found |
|
378 | 378 | |
|
379 | 379 | Preferring multiple values of an option works |
|
380 | 380 | |
|
381 | 381 | $ hg --config ui.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz |
|
382 | 382 | applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg |
|
383 | 383 | adding changesets |
|
384 | 384 | adding manifests |
|
385 | 385 | adding file changes |
|
386 | 386 | added 2 changesets with 2 changes to 2 files |
|
387 | 387 | finished applying clone bundle |
|
388 | 388 | searching for changes |
|
389 | 389 | no changes found |
|
390 | 390 | |
|
391 | 391 | Sorting multiple values should get us back to original first entry |
|
392 | 392 | |
|
393 | 393 | $ hg --config ui.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz |
|
394 | 394 | applying clone bundle from http://localhost:$HGPORT1/gz-a.hg |
|
395 | 395 | adding changesets |
|
396 | 396 | adding manifests |
|
397 | 397 | adding file changes |
|
398 | 398 | added 2 changesets with 2 changes to 2 files |
|
399 | 399 | finished applying clone bundle |
|
400 | 400 | searching for changes |
|
401 | 401 | no changes found |
|
402 | 402 | |
|
403 | 403 | Preferring multiple attributes has correct order |
|
404 | 404 | |
|
405 | 405 | $ hg --config ui.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes |
|
406 | 406 | applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg |
|
407 | 407 | adding changesets |
|
408 | 408 | adding manifests |
|
409 | 409 | adding file changes |
|
410 | 410 | added 2 changesets with 2 changes to 2 files |
|
411 | 411 | finished applying clone bundle |
|
412 | 412 | searching for changes |
|
413 | 413 | no changes found |
|
414 | 414 | |
|
415 | 415 | Test where attribute is missing from some entries |
|
416 | 416 | |
|
417 | 417 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
418 | 418 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 |
|
419 | 419 | > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 |
|
420 | 420 | > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b |
|
421 | 421 | > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b |
|
422 | 422 | > EOF |
|
423 | 423 | |
|
424 | 424 | $ hg --config ui.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute |
|
425 | 425 | applying clone bundle from http://localhost:$HGPORT1/gz-b.hg |
|
426 | 426 | adding changesets |
|
427 | 427 | adding manifests |
|
428 | 428 | adding file changes |
|
429 | 429 | added 2 changesets with 2 changes to 2 files |
|
430 | 430 | finished applying clone bundle |
|
431 | 431 | searching for changes |
|
432 | 432 | no changes found |
@@ -1,272 +1,272 b'' | |||
|
1 | 1 | #require serve |
|
2 | 2 | |
|
3 | 3 | = Test the getbundle() protocol function = |
|
4 | 4 | |
|
5 | 5 | Create a test repository: |
|
6 | 6 | |
|
7 | 7 | $ hg init repo |
|
8 | 8 | $ cd repo |
|
9 | 9 | $ hg debugbuilddag -n -m '+2 :fork +5 :p1 *fork +6 :p2 /p1 :m1 +3' > /dev/null |
|
10 | 10 | $ hg log -G --template '{node}\n' |
|
11 | 11 | o 10c14a2cc935e1d8c31f9e98587dcf27fb08a6da |
|
12 | 12 | | |
|
13 | 13 | o 4801a72e5d88cb515b0c7e40fae34180f3f837f2 |
|
14 | 14 | | |
|
15 | 15 | o 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 |
|
16 | 16 | | |
|
17 | 17 | o 8365676dbab05860ce0d9110f2af51368b961bbd |
|
18 | 18 | |\ |
|
19 | 19 | | o 5686dbbd9fc46cb806599c878d02fe1cb56b83d3 |
|
20 | 20 | | | |
|
21 | 21 | | o 13c0170174366b441dc68e8e33757232fa744458 |
|
22 | 22 | | | |
|
23 | 23 | | o 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 |
|
24 | 24 | | | |
|
25 | 25 | | o 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 |
|
26 | 26 | | | |
|
27 | 27 | | o 928b5f94cdb278bb536eba552de348a4e92ef24d |
|
28 | 28 | | | |
|
29 | 29 | | o f34414c64173e0ecb61b25dc55e116dbbcc89bee |
|
30 | 30 | | | |
|
31 | 31 | | o 8931463777131cd73923e560b760061f2aa8a4bc |
|
32 | 32 | | | |
|
33 | 33 | o | 6621d79f61b23ec74cf4b69464343d9e0980ec8b |
|
34 | 34 | | | |
|
35 | 35 | o | bac16991d12ff45f9dc43c52da1946dfadb83e80 |
|
36 | 36 | | | |
|
37 | 37 | o | ff42371d57168345fdf1a3aac66a51f6a45d41d2 |
|
38 | 38 | | | |
|
39 | 39 | o | d5f6e1ea452285324836a49d7d3c2a63cfed1d31 |
|
40 | 40 | | | |
|
41 | 41 | o | 713346a995c363120712aed1aee7e04afd867638 |
|
42 | 42 | |/ |
|
43 | 43 | o 29a4d1f17bd3f0779ca0525bebb1cfb51067c738 |
|
44 | 44 | | |
|
45 | 45 | o 7704483d56b2a7b5db54dcee7c62378ac629b348 |
|
46 | 46 | |
|
47 | 47 | $ cd .. |
|
48 | 48 | |
|
49 | 49 | |
|
50 | 50 | = Test locally = |
|
51 | 51 | |
|
52 | 52 | Get everything: |
|
53 | 53 | |
|
54 | 54 | $ hg debuggetbundle repo bundle |
|
55 | 55 | $ hg debugbundle bundle |
|
56 | 56 | 7704483d56b2a7b5db54dcee7c62378ac629b348 |
|
57 | 57 | 29a4d1f17bd3f0779ca0525bebb1cfb51067c738 |
|
58 | 58 | 713346a995c363120712aed1aee7e04afd867638 |
|
59 | 59 | d5f6e1ea452285324836a49d7d3c2a63cfed1d31 |
|
60 | 60 | ff42371d57168345fdf1a3aac66a51f6a45d41d2 |
|
61 | 61 | bac16991d12ff45f9dc43c52da1946dfadb83e80 |
|
62 | 62 | 6621d79f61b23ec74cf4b69464343d9e0980ec8b |
|
63 | 63 | 8931463777131cd73923e560b760061f2aa8a4bc |
|
64 | 64 | f34414c64173e0ecb61b25dc55e116dbbcc89bee |
|
65 | 65 | 928b5f94cdb278bb536eba552de348a4e92ef24d |
|
66 | 66 | 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 |
|
67 | 67 | 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 |
|
68 | 68 | 13c0170174366b441dc68e8e33757232fa744458 |
|
69 | 69 | 5686dbbd9fc46cb806599c878d02fe1cb56b83d3 |
|
70 | 70 | 8365676dbab05860ce0d9110f2af51368b961bbd |
|
71 | 71 | 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 |
|
72 | 72 | 4801a72e5d88cb515b0c7e40fae34180f3f837f2 |
|
73 | 73 | 10c14a2cc935e1d8c31f9e98587dcf27fb08a6da |
|
74 | 74 | |
|
75 | 75 | Get part of linear run: |
|
76 | 76 | |
|
77 | 77 | $ hg debuggetbundle repo bundle -H 4801a72e5d88cb515b0c7e40fae34180f3f837f2 -C 8365676dbab05860ce0d9110f2af51368b961bbd |
|
78 | 78 | $ hg debugbundle bundle |
|
79 | 79 | 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 |
|
80 | 80 | 4801a72e5d88cb515b0c7e40fae34180f3f837f2 |
|
81 | 81 | |
|
82 | 82 | Get missing branch and merge: |
|
83 | 83 | |
|
84 | 84 | $ hg debuggetbundle repo bundle -H 4801a72e5d88cb515b0c7e40fae34180f3f837f2 -C 13c0170174366b441dc68e8e33757232fa744458 |
|
85 | 85 | $ hg debugbundle bundle |
|
86 | 86 | 713346a995c363120712aed1aee7e04afd867638 |
|
87 | 87 | d5f6e1ea452285324836a49d7d3c2a63cfed1d31 |
|
88 | 88 | ff42371d57168345fdf1a3aac66a51f6a45d41d2 |
|
89 | 89 | bac16991d12ff45f9dc43c52da1946dfadb83e80 |
|
90 | 90 | 6621d79f61b23ec74cf4b69464343d9e0980ec8b |
|
91 | 91 | 5686dbbd9fc46cb806599c878d02fe1cb56b83d3 |
|
92 | 92 | 8365676dbab05860ce0d9110f2af51368b961bbd |
|
93 | 93 | 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 |
|
94 | 94 | 4801a72e5d88cb515b0c7e40fae34180f3f837f2 |
|
95 | 95 | |
|
96 | 96 | Get from only one head: |
|
97 | 97 | |
|
98 | 98 | $ hg debuggetbundle repo bundle -H 928b5f94cdb278bb536eba552de348a4e92ef24d -C 29a4d1f17bd3f0779ca0525bebb1cfb51067c738 |
|
99 | 99 | $ hg debugbundle bundle |
|
100 | 100 | 8931463777131cd73923e560b760061f2aa8a4bc |
|
101 | 101 | f34414c64173e0ecb61b25dc55e116dbbcc89bee |
|
102 | 102 | 928b5f94cdb278bb536eba552de348a4e92ef24d |
|
103 | 103 | |
|
104 | 104 | Get parts of two branches: |
|
105 | 105 | |
|
106 | 106 | $ hg debuggetbundle repo bundle -H 13c0170174366b441dc68e8e33757232fa744458 -C 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 -H bac16991d12ff45f9dc43c52da1946dfadb83e80 -C d5f6e1ea452285324836a49d7d3c2a63cfed1d31 |
|
107 | 107 | $ hg debugbundle bundle |
|
108 | 108 | ff42371d57168345fdf1a3aac66a51f6a45d41d2 |
|
109 | 109 | bac16991d12ff45f9dc43c52da1946dfadb83e80 |
|
110 | 110 | 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 |
|
111 | 111 | 13c0170174366b441dc68e8e33757232fa744458 |
|
112 | 112 | |
|
113 | 113 | Check that we get all needed file changes: |
|
114 | 114 | |
|
115 | 115 | $ hg debugbundle bundle --all |
|
116 | 116 | format: id, p1, p2, cset, delta base, len(delta) |
|
117 | 117 | |
|
118 | 118 | changelog |
|
119 | 119 | ff42371d57168345fdf1a3aac66a51f6a45d41d2 d5f6e1ea452285324836a49d7d3c2a63cfed1d31 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 d5f6e1ea452285324836a49d7d3c2a63cfed1d31 99 |
|
120 | 120 | bac16991d12ff45f9dc43c52da1946dfadb83e80 ff42371d57168345fdf1a3aac66a51f6a45d41d2 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 ff42371d57168345fdf1a3aac66a51f6a45d41d2 99 |
|
121 | 121 | 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 bac16991d12ff45f9dc43c52da1946dfadb83e80 102 |
|
122 | 122 | 13c0170174366b441dc68e8e33757232fa744458 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 102 |
|
123 | 123 | |
|
124 | 124 | manifest |
|
125 | 125 | dac7984588fc4eea7acbf39693a9c1b06f5b175d 591f732a3faf1fb903815273f3c199a514a61ccb 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 591f732a3faf1fb903815273f3c199a514a61ccb 113 |
|
126 | 126 | 0772616e6b48a76afb6c1458e193cbb3dae2e4ff dac7984588fc4eea7acbf39693a9c1b06f5b175d 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 dac7984588fc4eea7acbf39693a9c1b06f5b175d 113 |
|
127 | 127 | eb498cd9af6c44108e43041e951ce829e29f6c80 bff2f4817ced57b386caf7c4e3e36a4bc9af7e93 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 0772616e6b48a76afb6c1458e193cbb3dae2e4ff 295 |
|
128 | 128 | b15709c071ddd2d93188508ba156196ab4f19620 eb498cd9af6c44108e43041e951ce829e29f6c80 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 eb498cd9af6c44108e43041e951ce829e29f6c80 114 |
|
129 | 129 | |
|
130 | 130 | mf |
|
131 | 131 | 4f73f97080266ab8e0c0561ca8d0da3eaf65b695 301ca08d026bb72cb4258a9d211bdf7ca0bcd810 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 301ca08d026bb72cb4258a9d211bdf7ca0bcd810 17 |
|
132 | 132 | c7b583de053293870e145f45bd2d61643563fd06 4f73f97080266ab8e0c0561ca8d0da3eaf65b695 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 4f73f97080266ab8e0c0561ca8d0da3eaf65b695 18 |
|
133 | 133 | 266ee3c0302a5a18f1cf96817ac79a51836179e9 edc0f6b8db80d68ae6aff2b19f7e5347ab68fa63 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 c7b583de053293870e145f45bd2d61643563fd06 149 |
|
134 | 134 | 698c6a36220548cd3903ca7dada27c59aa500c52 266ee3c0302a5a18f1cf96817ac79a51836179e9 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 266ee3c0302a5a18f1cf96817ac79a51836179e9 19 |
|
135 | 135 | |
|
136 | 136 | nf11 |
|
137 | 137 | 33fbc651630ffa7ccbebfe4eb91320a873e7291c 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 0000000000000000000000000000000000000000 16 |
|
138 | 138 | |
|
139 | 139 | nf12 |
|
140 | 140 | ddce0544363f037e9fb889faca058f52dc01c0a5 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 0000000000000000000000000000000000000000 16 |
|
141 | 141 | |
|
142 | 142 | nf4 |
|
143 | 143 | 3c1407305701051cbed9f9cb9a68bdfb5997c235 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 0000000000000000000000000000000000000000 15 |
|
144 | 144 | |
|
145 | 145 | nf5 |
|
146 | 146 | 0dbd89c185f53a1727c54cd1ce256482fa23968e 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 0000000000000000000000000000000000000000 15 |
|
147 | 147 | |
|
148 | 148 | Get branch and merge: |
|
149 | 149 | |
|
150 | 150 | $ hg debuggetbundle repo bundle -C 7704483d56b2a7b5db54dcee7c62378ac629b348 -H 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 |
|
151 | 151 | $ hg debugbundle bundle |
|
152 | 152 | 29a4d1f17bd3f0779ca0525bebb1cfb51067c738 |
|
153 | 153 | 713346a995c363120712aed1aee7e04afd867638 |
|
154 | 154 | d5f6e1ea452285324836a49d7d3c2a63cfed1d31 |
|
155 | 155 | ff42371d57168345fdf1a3aac66a51f6a45d41d2 |
|
156 | 156 | bac16991d12ff45f9dc43c52da1946dfadb83e80 |
|
157 | 157 | 6621d79f61b23ec74cf4b69464343d9e0980ec8b |
|
158 | 158 | 8931463777131cd73923e560b760061f2aa8a4bc |
|
159 | 159 | f34414c64173e0ecb61b25dc55e116dbbcc89bee |
|
160 | 160 | 928b5f94cdb278bb536eba552de348a4e92ef24d |
|
161 | 161 | 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 |
|
162 | 162 | 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 |
|
163 | 163 | 13c0170174366b441dc68e8e33757232fa744458 |
|
164 | 164 | 5686dbbd9fc46cb806599c878d02fe1cb56b83d3 |
|
165 | 165 | 8365676dbab05860ce0d9110f2af51368b961bbd |
|
166 | 166 | 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 |
|
167 | 167 | |
|
168 | 168 | = Test bundle2 = |
|
169 | 169 | |
|
170 | 170 | $ hg debuggetbundle repo bundle -t bundle2 |
|
171 | 171 | $ hg debugbundle bundle |
|
172 | 172 | Stream params: {} |
|
173 | 173 | changegroup -- "sortdict([('version', '01')])" |
|
174 | 174 | 7704483d56b2a7b5db54dcee7c62378ac629b348 |
|
175 | 175 | 29a4d1f17bd3f0779ca0525bebb1cfb51067c738 |
|
176 | 176 | 713346a995c363120712aed1aee7e04afd867638 |
|
177 | 177 | d5f6e1ea452285324836a49d7d3c2a63cfed1d31 |
|
178 | 178 | ff42371d57168345fdf1a3aac66a51f6a45d41d2 |
|
179 | 179 | bac16991d12ff45f9dc43c52da1946dfadb83e80 |
|
180 | 180 | 6621d79f61b23ec74cf4b69464343d9e0980ec8b |
|
181 | 181 | 8931463777131cd73923e560b760061f2aa8a4bc |
|
182 | 182 | f34414c64173e0ecb61b25dc55e116dbbcc89bee |
|
183 | 183 | 928b5f94cdb278bb536eba552de348a4e92ef24d |
|
184 | 184 | 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 |
|
185 | 185 | 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 |
|
186 | 186 | 13c0170174366b441dc68e8e33757232fa744458 |
|
187 | 187 | 5686dbbd9fc46cb806599c878d02fe1cb56b83d3 |
|
188 | 188 | 8365676dbab05860ce0d9110f2af51368b961bbd |
|
189 | 189 | 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 |
|
190 | 190 | 4801a72e5d88cb515b0c7e40fae34180f3f837f2 |
|
191 | 191 | 10c14a2cc935e1d8c31f9e98587dcf27fb08a6da |
|
192 | 192 | = Test via HTTP = |
|
193 | 193 | |
|
194 | 194 | Get everything: |
|
195 | 195 | |
|
196 | 196 | $ hg serve -R repo -p $HGPORT -d --pid-file=hg.pid -E error.log -A access.log |
|
197 | 197 | $ cat hg.pid >> $DAEMON_PIDS |
|
198 | 198 | $ hg debuggetbundle http://localhost:$HGPORT/ bundle |
|
199 | 199 | $ hg debugbundle bundle |
|
200 | 200 | 7704483d56b2a7b5db54dcee7c62378ac629b348 |
|
201 | 201 | 29a4d1f17bd3f0779ca0525bebb1cfb51067c738 |
|
202 | 202 | 713346a995c363120712aed1aee7e04afd867638 |
|
203 | 203 | d5f6e1ea452285324836a49d7d3c2a63cfed1d31 |
|
204 | 204 | ff42371d57168345fdf1a3aac66a51f6a45d41d2 |
|
205 | 205 | bac16991d12ff45f9dc43c52da1946dfadb83e80 |
|
206 | 206 | 6621d79f61b23ec74cf4b69464343d9e0980ec8b |
|
207 | 207 | 8931463777131cd73923e560b760061f2aa8a4bc |
|
208 | 208 | f34414c64173e0ecb61b25dc55e116dbbcc89bee |
|
209 | 209 | 928b5f94cdb278bb536eba552de348a4e92ef24d |
|
210 | 210 | 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 |
|
211 | 211 | 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 |
|
212 | 212 | 13c0170174366b441dc68e8e33757232fa744458 |
|
213 | 213 | 5686dbbd9fc46cb806599c878d02fe1cb56b83d3 |
|
214 | 214 | 8365676dbab05860ce0d9110f2af51368b961bbd |
|
215 | 215 | 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 |
|
216 | 216 | 4801a72e5d88cb515b0c7e40fae34180f3f837f2 |
|
217 | 217 | 10c14a2cc935e1d8c31f9e98587dcf27fb08a6da |
|
218 | 218 | |
|
219 | 219 | Get parts of two branches: |
|
220 | 220 | |
|
221 | 221 | $ hg debuggetbundle http://localhost:$HGPORT/ bundle -H 13c0170174366b441dc68e8e33757232fa744458 -C 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 -H bac16991d12ff45f9dc43c52da1946dfadb83e80 -C d5f6e1ea452285324836a49d7d3c2a63cfed1d31 |
|
222 | 222 | $ hg debugbundle bundle |
|
223 | 223 | ff42371d57168345fdf1a3aac66a51f6a45d41d2 |
|
224 | 224 | bac16991d12ff45f9dc43c52da1946dfadb83e80 |
|
225 | 225 | 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 |
|
226 | 226 | 13c0170174366b441dc68e8e33757232fa744458 |
|
227 | 227 | |
|
228 | 228 | Check that we get all needed file changes: |
|
229 | 229 | |
|
230 | 230 | $ hg debugbundle bundle --all |
|
231 | 231 | format: id, p1, p2, cset, delta base, len(delta) |
|
232 | 232 | |
|
233 | 233 | changelog |
|
234 | 234 | ff42371d57168345fdf1a3aac66a51f6a45d41d2 d5f6e1ea452285324836a49d7d3c2a63cfed1d31 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 d5f6e1ea452285324836a49d7d3c2a63cfed1d31 99 |
|
235 | 235 | bac16991d12ff45f9dc43c52da1946dfadb83e80 ff42371d57168345fdf1a3aac66a51f6a45d41d2 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 ff42371d57168345fdf1a3aac66a51f6a45d41d2 99 |
|
236 | 236 | 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 bac16991d12ff45f9dc43c52da1946dfadb83e80 102 |
|
237 | 237 | 13c0170174366b441dc68e8e33757232fa744458 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 102 |
|
238 | 238 | |
|
239 | 239 | manifest |
|
240 | 240 | dac7984588fc4eea7acbf39693a9c1b06f5b175d 591f732a3faf1fb903815273f3c199a514a61ccb 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 591f732a3faf1fb903815273f3c199a514a61ccb 113 |
|
241 | 241 | 0772616e6b48a76afb6c1458e193cbb3dae2e4ff dac7984588fc4eea7acbf39693a9c1b06f5b175d 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 dac7984588fc4eea7acbf39693a9c1b06f5b175d 113 |
|
242 | 242 | eb498cd9af6c44108e43041e951ce829e29f6c80 bff2f4817ced57b386caf7c4e3e36a4bc9af7e93 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 0772616e6b48a76afb6c1458e193cbb3dae2e4ff 295 |
|
243 | 243 | b15709c071ddd2d93188508ba156196ab4f19620 eb498cd9af6c44108e43041e951ce829e29f6c80 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 eb498cd9af6c44108e43041e951ce829e29f6c80 114 |
|
244 | 244 | |
|
245 | 245 | mf |
|
246 | 246 | 4f73f97080266ab8e0c0561ca8d0da3eaf65b695 301ca08d026bb72cb4258a9d211bdf7ca0bcd810 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 301ca08d026bb72cb4258a9d211bdf7ca0bcd810 17 |
|
247 | 247 | c7b583de053293870e145f45bd2d61643563fd06 4f73f97080266ab8e0c0561ca8d0da3eaf65b695 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 4f73f97080266ab8e0c0561ca8d0da3eaf65b695 18 |
|
248 | 248 | 266ee3c0302a5a18f1cf96817ac79a51836179e9 edc0f6b8db80d68ae6aff2b19f7e5347ab68fa63 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 c7b583de053293870e145f45bd2d61643563fd06 149 |
|
249 | 249 | 698c6a36220548cd3903ca7dada27c59aa500c52 266ee3c0302a5a18f1cf96817ac79a51836179e9 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 266ee3c0302a5a18f1cf96817ac79a51836179e9 19 |
|
250 | 250 | |
|
251 | 251 | nf11 |
|
252 | 252 | 33fbc651630ffa7ccbebfe4eb91320a873e7291c 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 0000000000000000000000000000000000000000 16 |
|
253 | 253 | |
|
254 | 254 | nf12 |
|
255 | 255 | ddce0544363f037e9fb889faca058f52dc01c0a5 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 0000000000000000000000000000000000000000 16 |
|
256 | 256 | |
|
257 | 257 | nf4 |
|
258 | 258 | 3c1407305701051cbed9f9cb9a68bdfb5997c235 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 0000000000000000000000000000000000000000 15 |
|
259 | 259 | |
|
260 | 260 | nf5 |
|
261 | 261 | 0dbd89c185f53a1727c54cd1ce256482fa23968e 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 0000000000000000000000000000000000000000 15 |
|
262 | 262 | |
|
263 | 263 | Verify we hit the HTTP server: |
|
264 | 264 | |
|
265 | 265 | $ cat access.log |
|
266 | 266 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
267 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - (glob) | |
|
267 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
268 | 268 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
269 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=700b7e19db54103633c4bf4a6a6b6d55f4d50c03+d5f6e1ea452285324836a49d7d3c2a63cfed1d31&heads=13c0170174366b441dc68e8e33757232fa744458+bac16991d12ff45f9dc43c52da1946dfadb83e80 (glob) | |
|
269 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=700b7e19db54103633c4bf4a6a6b6d55f4d50c03+d5f6e1ea452285324836a49d7d3c2a63cfed1d31&heads=13c0170174366b441dc68e8e33757232fa744458+bac16991d12ff45f9dc43c52da1946dfadb83e80 x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
270 | 270 | |
|
271 | 271 | $ cat error.log |
|
272 | 272 |
@@ -1,335 +1,335 b'' | |||
|
1 | 1 | #require serve |
|
2 | 2 | |
|
3 | 3 | This test is a duplicate of 'test-http.t', feel free to factor out |
|
4 | 4 | parts that are not bundle1/bundle2 specific. |
|
5 | 5 | |
|
6 | 6 | $ cat << EOF >> $HGRCPATH |
|
7 | 7 | > [devel] |
|
8 | 8 | > # This test is dedicated to interaction through old bundle |
|
9 | 9 | > legacy.exchange = bundle1 |
|
10 | 10 | > EOF |
|
11 | 11 | |
|
12 | 12 | $ hg init test |
|
13 | 13 | $ cd test |
|
14 | 14 | $ echo foo>foo |
|
15 | 15 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg |
|
16 | 16 | $ echo foo>foo.d/foo |
|
17 | 17 | $ echo bar>foo.d/bAr.hg.d/BaR |
|
18 | 18 | $ echo bar>foo.d/baR.d.hg/bAR |
|
19 | 19 | $ hg commit -A -m 1 |
|
20 | 20 | adding foo |
|
21 | 21 | adding foo.d/bAr.hg.d/BaR |
|
22 | 22 | adding foo.d/baR.d.hg/bAR |
|
23 | 23 | adding foo.d/foo |
|
24 | 24 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log |
|
25 | 25 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid |
|
26 | 26 | |
|
27 | 27 | Test server address cannot be reused |
|
28 | 28 | |
|
29 | 29 | #if windows |
|
30 | 30 | $ hg serve -p $HGPORT1 2>&1 |
|
31 | 31 | abort: cannot start server at ':$HGPORT1': * (glob) |
|
32 | 32 | [255] |
|
33 | 33 | #else |
|
34 | 34 | $ hg serve -p $HGPORT1 2>&1 |
|
35 | 35 | abort: cannot start server at ':$HGPORT1': Address already in use |
|
36 | 36 | [255] |
|
37 | 37 | #endif |
|
38 | 38 | $ cd .. |
|
39 | 39 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS |
|
40 | 40 | |
|
41 | 41 | clone via stream |
|
42 | 42 | |
|
43 | 43 | $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 |
|
44 | 44 | streaming all changes |
|
45 | 45 | 6 files to transfer, 606 bytes of data |
|
46 | 46 | transferred * bytes in * seconds (*/sec) (glob) |
|
47 | 47 | searching for changes |
|
48 | 48 | no changes found |
|
49 | 49 | updating to branch default |
|
50 | 50 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
51 | 51 | $ hg verify -R copy |
|
52 | 52 | checking changesets |
|
53 | 53 | checking manifests |
|
54 | 54 | crosschecking files in changesets and manifests |
|
55 | 55 | checking files |
|
56 | 56 | 4 files, 1 changesets, 4 total revisions |
|
57 | 57 | |
|
58 | 58 | try to clone via stream, should use pull instead |
|
59 | 59 | |
|
60 | 60 | $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2 |
|
61 | 61 | requesting all changes |
|
62 | 62 | adding changesets |
|
63 | 63 | adding manifests |
|
64 | 64 | adding file changes |
|
65 | 65 | added 1 changesets with 4 changes to 4 files |
|
66 | 66 | updating to branch default |
|
67 | 67 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
68 | 68 | |
|
69 | 69 | clone via pull |
|
70 | 70 | |
|
71 | 71 | $ hg clone http://localhost:$HGPORT1/ copy-pull |
|
72 | 72 | requesting all changes |
|
73 | 73 | adding changesets |
|
74 | 74 | adding manifests |
|
75 | 75 | adding file changes |
|
76 | 76 | added 1 changesets with 4 changes to 4 files |
|
77 | 77 | updating to branch default |
|
78 | 78 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
79 | 79 | $ hg verify -R copy-pull |
|
80 | 80 | checking changesets |
|
81 | 81 | checking manifests |
|
82 | 82 | crosschecking files in changesets and manifests |
|
83 | 83 | checking files |
|
84 | 84 | 4 files, 1 changesets, 4 total revisions |
|
85 | 85 | $ cd test |
|
86 | 86 | $ echo bar > bar |
|
87 | 87 | $ hg commit -A -d '1 0' -m 2 |
|
88 | 88 | adding bar |
|
89 | 89 | $ cd .. |
|
90 | 90 | |
|
91 | 91 | clone over http with --update |
|
92 | 92 | |
|
93 | 93 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 |
|
94 | 94 | requesting all changes |
|
95 | 95 | adding changesets |
|
96 | 96 | adding manifests |
|
97 | 97 | adding file changes |
|
98 | 98 | added 2 changesets with 5 changes to 5 files |
|
99 | 99 | updating to branch default |
|
100 | 100 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
101 | 101 | $ hg log -r . -R updated |
|
102 | 102 | changeset: 0:8b6053c928fe |
|
103 | 103 | user: test |
|
104 | 104 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
105 | 105 | summary: 1 |
|
106 | 106 | |
|
107 | 107 | $ rm -rf updated |
|
108 | 108 | |
|
109 | 109 | incoming via HTTP |
|
110 | 110 | |
|
111 | 111 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial |
|
112 | 112 | adding changesets |
|
113 | 113 | adding manifests |
|
114 | 114 | adding file changes |
|
115 | 115 | added 1 changesets with 4 changes to 4 files |
|
116 | 116 | updating to branch default |
|
117 | 117 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
118 | 118 | $ cd partial |
|
119 | 119 | $ touch LOCAL |
|
120 | 120 | $ hg ci -qAm LOCAL |
|
121 | 121 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' |
|
122 | 122 | comparing with http://localhost:$HGPORT1/ |
|
123 | 123 | searching for changes |
|
124 | 124 | 2 |
|
125 | 125 | $ cd .. |
|
126 | 126 | |
|
127 | 127 | pull |
|
128 | 128 | |
|
129 | 129 | $ cd copy-pull |
|
130 | 130 | $ cat >> .hg/hgrc <<EOF |
|
131 | 131 | > [hooks] |
|
132 | 132 | > changegroup = sh -c "printenv.py changegroup" |
|
133 | 133 | > EOF |
|
134 | 134 | $ hg pull |
|
135 | 135 | pulling from http://localhost:$HGPORT1/ |
|
136 | 136 | searching for changes |
|
137 | 137 | adding changesets |
|
138 | 138 | adding manifests |
|
139 | 139 | adding file changes |
|
140 | 140 | added 1 changesets with 1 changes to 1 files |
|
141 | 141 | changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=http://localhost:$HGPORT1/ (glob) |
|
142 | 142 | (run 'hg update' to get a working copy) |
|
143 | 143 | $ cd .. |
|
144 | 144 | |
|
145 | 145 | clone from invalid URL |
|
146 | 146 | |
|
147 | 147 | $ hg clone http://localhost:$HGPORT/bad |
|
148 | 148 | abort: HTTP Error 404: Not Found |
|
149 | 149 | [255] |
|
150 | 150 | |
|
151 | 151 | test http authentication |
|
152 | 152 | + use the same server to test server side streaming preference |
|
153 | 153 | |
|
154 | 154 | $ cd test |
|
155 | 155 | $ cat << EOT > userpass.py |
|
156 | 156 | > import base64 |
|
157 | 157 | > from mercurial.hgweb import common |
|
158 | 158 | > def perform_authentication(hgweb, req, op): |
|
159 | 159 | > auth = req.env.get('HTTP_AUTHORIZATION') |
|
160 | 160 | > if not auth: |
|
161 | 161 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', |
|
162 | 162 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) |
|
163 | 163 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: |
|
164 | 164 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') |
|
165 | 165 | > def extsetup(): |
|
166 | 166 | > common.permhooks.insert(0, perform_authentication) |
|
167 | 167 | > EOT |
|
168 | 168 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ |
|
169 | 169 | > --config server.preferuncompressed=True \ |
|
170 | 170 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log |
|
171 | 171 | $ cat pid >> $DAEMON_PIDS |
|
172 | 172 | |
|
173 | 173 | $ cat << EOF > get_pass.py |
|
174 | 174 | > import getpass |
|
175 | 175 | > def newgetpass(arg): |
|
176 | 176 | > return "pass" |
|
177 | 177 | > getpass.getpass = newgetpass |
|
178 | 178 | > EOF |
|
179 | 179 | |
|
180 | 180 | $ hg id http://localhost:$HGPORT2/ |
|
181 | 181 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
182 | 182 | [255] |
|
183 | 183 | $ hg id http://localhost:$HGPORT2/ |
|
184 | 184 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
185 | 185 | [255] |
|
186 | 186 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ |
|
187 | 187 | http authorization required for http://localhost:$HGPORT2/ |
|
188 | 188 | realm: mercurial |
|
189 | 189 | user: user |
|
190 | 190 | password: 5fed3813f7f5 |
|
191 | 191 | $ hg id http://user:pass@localhost:$HGPORT2/ |
|
192 | 192 | 5fed3813f7f5 |
|
193 | 193 | $ echo '[auth]' >> .hg/hgrc |
|
194 | 194 | $ echo 'l.schemes=http' >> .hg/hgrc |
|
195 | 195 | $ echo 'l.prefix=lo' >> .hg/hgrc |
|
196 | 196 | $ echo 'l.username=user' >> .hg/hgrc |
|
197 | 197 | $ echo 'l.password=pass' >> .hg/hgrc |
|
198 | 198 | $ hg id http://localhost:$HGPORT2/ |
|
199 | 199 | 5fed3813f7f5 |
|
200 | 200 | $ hg id http://localhost:$HGPORT2/ |
|
201 | 201 | 5fed3813f7f5 |
|
202 | 202 | $ hg id http://user@localhost:$HGPORT2/ |
|
203 | 203 | 5fed3813f7f5 |
|
204 | 204 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 |
|
205 | 205 | streaming all changes |
|
206 | 206 | 7 files to transfer, 916 bytes of data |
|
207 | 207 | transferred * bytes in * seconds (*/sec) (glob) |
|
208 | 208 | searching for changes |
|
209 | 209 | no changes found |
|
210 | 210 | updating to branch default |
|
211 | 211 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
212 | 212 | --pull should override server's preferuncompressed |
|
213 | 213 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 |
|
214 | 214 | requesting all changes |
|
215 | 215 | adding changesets |
|
216 | 216 | adding manifests |
|
217 | 217 | adding file changes |
|
218 | 218 | added 2 changesets with 5 changes to 5 files |
|
219 | 219 | updating to branch default |
|
220 | 220 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
221 | 221 | |
|
222 | 222 | $ hg id http://user2@localhost:$HGPORT2/ |
|
223 | 223 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
224 | 224 | [255] |
|
225 | 225 | $ hg id http://user:pass2@localhost:$HGPORT2/ |
|
226 | 226 | abort: HTTP Error 403: no |
|
227 | 227 | [255] |
|
228 | 228 | |
|
229 | 229 | $ hg -R dest tag -r tip top |
|
230 | 230 | $ hg -R dest push http://user:pass@localhost:$HGPORT2/ |
|
231 | 231 | pushing to http://user:***@localhost:$HGPORT2/ |
|
232 | 232 | searching for changes |
|
233 | 233 | remote: adding changesets |
|
234 | 234 | remote: adding manifests |
|
235 | 235 | remote: adding file changes |
|
236 | 236 | remote: added 1 changesets with 1 changes to 1 files |
|
237 | 237 | $ hg rollback -q |
|
238 | 238 | |
|
239 | 239 | $ sed 's/.*] "/"/' < ../access.log |
|
240 | 240 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
241 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
242 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
241 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
242 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
243 | 243 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
244 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
245 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
244 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
245 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
246 | 246 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
247 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
248 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
249 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
|
250 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
247 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
248 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
249 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
250 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
251 | 251 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
252 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
253 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
254 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
|
255 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
252 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
253 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
254 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
255 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
256 | 256 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
257 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
258 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
259 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
|
260 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
257 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
258 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
259 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
260 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
261 | 261 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
262 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
263 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
264 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
|
265 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
262 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
263 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
264 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
265 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
266 | 266 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
267 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
268 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
269 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
|
270 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
267 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
268 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
269 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
270 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
271 | 271 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
272 | "GET /?cmd=branchmap HTTP/1.1" 200 - | |
|
273 | "GET /?cmd=stream_out HTTP/1.1" 401 - | |
|
274 | "GET /?cmd=stream_out HTTP/1.1" 200 - | |
|
275 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
276 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d | |
|
277 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
|
272 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
273 | "GET /?cmd=stream_out HTTP/1.1" 401 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
274 | "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
275 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
276 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
277 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
278 | 278 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
279 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks | |
|
280 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
281 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D | |
|
282 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d | |
|
283 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
|
279 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
280 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
281 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
282 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
283 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
284 | 284 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
285 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
286 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
285 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
286 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
287 | 287 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
288 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
289 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
290 | "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces | |
|
288 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
289 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
290 | "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
291 | 291 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
292 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 | |
|
293 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases | |
|
294 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
|
295 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
296 | "GET /?cmd=branchmap HTTP/1.1" 200 - | |
|
297 | "GET /?cmd=branchmap HTTP/1.1" 200 - | |
|
298 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
292 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
293 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
294 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
295 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
296 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
297 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
298 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
299 | 299 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+5eb5abfefeea63c80dd7553bcc3783f37e0c5524* (glob) |
|
300 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
|
300 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
301 | 301 | |
|
302 | 302 | $ cd .. |
|
303 | 303 | |
|
304 | 304 | clone of serve with repo in root and unserved subrepo (issue2970) |
|
305 | 305 | |
|
306 | 306 | $ hg --cwd test init sub |
|
307 | 307 | $ echo empty > test/sub/empty |
|
308 | 308 | $ hg --cwd test/sub add empty |
|
309 | 309 | $ hg --cwd test/sub commit -qm 'add empty' |
|
310 | 310 | $ hg --cwd test/sub tag -r 0 something |
|
311 | 311 | $ echo sub = sub > test/.hgsub |
|
312 | 312 | $ hg --cwd test add .hgsub |
|
313 | 313 | $ hg --cwd test commit -qm 'add subrepo' |
|
314 | 314 | $ hg clone http://localhost:$HGPORT noslash-clone |
|
315 | 315 | requesting all changes |
|
316 | 316 | adding changesets |
|
317 | 317 | adding manifests |
|
318 | 318 | adding file changes |
|
319 | 319 | added 3 changesets with 7 changes to 7 files |
|
320 | 320 | updating to branch default |
|
321 | 321 | abort: HTTP Error 404: Not Found |
|
322 | 322 | [255] |
|
323 | 323 | $ hg clone http://localhost:$HGPORT/ slash-clone |
|
324 | 324 | requesting all changes |
|
325 | 325 | adding changesets |
|
326 | 326 | adding manifests |
|
327 | 327 | adding file changes |
|
328 | 328 | added 3 changesets with 7 changes to 7 files |
|
329 | 329 | updating to branch default |
|
330 | 330 | abort: HTTP Error 404: Not Found |
|
331 | 331 | [255] |
|
332 | 332 | |
|
333 | 333 | check error log |
|
334 | 334 | |
|
335 | 335 | $ cat error.log |
@@ -1,119 +1,119 b'' | |||
|
1 | 1 | #require serve |
|
2 | 2 | |
|
3 | 3 | $ hg init a |
|
4 | 4 | $ cd a |
|
5 | 5 | $ echo a > a |
|
6 | 6 | $ hg ci -Ama -d '1123456789 0' |
|
7 | 7 | adding a |
|
8 | 8 | $ hg serve --config server.uncompressed=True -p $HGPORT -d --pid-file=hg.pid |
|
9 | 9 | $ cat hg.pid >> $DAEMON_PIDS |
|
10 | 10 | $ cd .. |
|
11 | 11 | $ tinyproxy.py $HGPORT1 localhost >proxy.log 2>&1 </dev/null & |
|
12 | 12 | $ while [ ! -f proxy.pid ]; do sleep 0; done |
|
13 | 13 | $ cat proxy.pid >> $DAEMON_PIDS |
|
14 | 14 | |
|
15 | 15 | url for proxy, stream |
|
16 | 16 | |
|
17 | 17 | $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --uncompressed http://localhost:$HGPORT/ b |
|
18 | 18 | streaming all changes |
|
19 | 19 | 3 files to transfer, 303 bytes of data |
|
20 | 20 | transferred * bytes in * seconds (*/sec) (glob) |
|
21 | 21 | searching for changes |
|
22 | 22 | no changes found |
|
23 | 23 | updating to branch default |
|
24 | 24 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
25 | 25 | $ cd b |
|
26 | 26 | $ hg verify |
|
27 | 27 | checking changesets |
|
28 | 28 | checking manifests |
|
29 | 29 | crosschecking files in changesets and manifests |
|
30 | 30 | checking files |
|
31 | 31 | 1 files, 1 changesets, 1 total revisions |
|
32 | 32 | $ cd .. |
|
33 | 33 | |
|
34 | 34 | url for proxy, pull |
|
35 | 35 | |
|
36 | 36 | $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull |
|
37 | 37 | requesting all changes |
|
38 | 38 | adding changesets |
|
39 | 39 | adding manifests |
|
40 | 40 | adding file changes |
|
41 | 41 | added 1 changesets with 1 changes to 1 files |
|
42 | 42 | updating to branch default |
|
43 | 43 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
44 | 44 | $ cd b-pull |
|
45 | 45 | $ hg verify |
|
46 | 46 | checking changesets |
|
47 | 47 | checking manifests |
|
48 | 48 | crosschecking files in changesets and manifests |
|
49 | 49 | checking files |
|
50 | 50 | 1 files, 1 changesets, 1 total revisions |
|
51 | 51 | $ cd .. |
|
52 | 52 | |
|
53 | 53 | host:port for proxy |
|
54 | 54 | |
|
55 | 55 | $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c |
|
56 | 56 | requesting all changes |
|
57 | 57 | adding changesets |
|
58 | 58 | adding manifests |
|
59 | 59 | adding file changes |
|
60 | 60 | added 1 changesets with 1 changes to 1 files |
|
61 | 61 | updating to branch default |
|
62 | 62 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
63 | 63 | |
|
64 | 64 | proxy url with user name and password |
|
65 | 65 | |
|
66 | 66 | $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d |
|
67 | 67 | requesting all changes |
|
68 | 68 | adding changesets |
|
69 | 69 | adding manifests |
|
70 | 70 | adding file changes |
|
71 | 71 | added 1 changesets with 1 changes to 1 files |
|
72 | 72 | updating to branch default |
|
73 | 73 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
74 | 74 | |
|
75 | 75 | url with user name and password |
|
76 | 76 | |
|
77 | 77 | $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e |
|
78 | 78 | requesting all changes |
|
79 | 79 | adding changesets |
|
80 | 80 | adding manifests |
|
81 | 81 | adding file changes |
|
82 | 82 | added 1 changesets with 1 changes to 1 files |
|
83 | 83 | updating to branch default |
|
84 | 84 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
85 | 85 | |
|
86 | 86 | bad host:port for proxy |
|
87 | 87 | |
|
88 | 88 | $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f |
|
89 | 89 | abort: error: Connection refused |
|
90 | 90 | [255] |
|
91 | 91 | |
|
92 | 92 | do not use the proxy if it is in the no list |
|
93 | 93 | |
|
94 | 94 | $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g |
|
95 | 95 | requesting all changes |
|
96 | 96 | adding changesets |
|
97 | 97 | adding manifests |
|
98 | 98 | adding file changes |
|
99 | 99 | added 1 changesets with 1 changes to 1 files |
|
100 | 100 | updating to branch default |
|
101 | 101 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
102 | 102 | $ cat proxy.log |
|
103 | 103 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
104 | * - - [*] "GET http://localhost:$HGPORT/?cmd=branchmap HTTP/1.1" - - (glob) | |
|
105 | * - - [*] "GET http://localhost:$HGPORT/?cmd=stream_out HTTP/1.1" - - (glob) | |
|
106 | * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D83180e7845de420a1bb46896fd5fe05294f8d629 (glob) | |
|
107 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=83180e7845de420a1bb46896fd5fe05294f8d629&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=phases%2Cbookmarks (glob) | |
|
104 | * - - [*] "GET http://localhost:$HGPORT/?cmd=branchmap HTTP/1.1" - - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
105 | * - - [*] "GET http://localhost:$HGPORT/?cmd=stream_out HTTP/1.1" - - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
106 | * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D83180e7845de420a1bb46896fd5fe05294f8d629 x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
107 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=83180e7845de420a1bb46896fd5fe05294f8d629&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
108 | 108 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
109 | * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) | |
|
110 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=phases%2Cbookmarks (glob) | |
|
109 | * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
110 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
111 | 111 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
112 | * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) | |
|
113 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=phases%2Cbookmarks (glob) | |
|
112 | * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
113 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
114 | 114 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
115 | * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) | |
|
116 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=phases%2Cbookmarks (glob) | |
|
115 | * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
116 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
117 | 117 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
118 | * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) | |
|
119 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=phases%2Cbookmarks (glob) | |
|
118 | * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
119 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
@@ -1,323 +1,323 b'' | |||
|
1 | 1 | #require serve |
|
2 | 2 | |
|
3 | 3 | $ hg init test |
|
4 | 4 | $ cd test |
|
5 | 5 | $ echo foo>foo |
|
6 | 6 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg |
|
7 | 7 | $ echo foo>foo.d/foo |
|
8 | 8 | $ echo bar>foo.d/bAr.hg.d/BaR |
|
9 | 9 | $ echo bar>foo.d/baR.d.hg/bAR |
|
10 | 10 | $ hg commit -A -m 1 |
|
11 | 11 | adding foo |
|
12 | 12 | adding foo.d/bAr.hg.d/BaR |
|
13 | 13 | adding foo.d/baR.d.hg/bAR |
|
14 | 14 | adding foo.d/foo |
|
15 | 15 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log |
|
16 | 16 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid |
|
17 | 17 | |
|
18 | 18 | Test server address cannot be reused |
|
19 | 19 | |
|
20 | 20 | #if windows |
|
21 | 21 | $ hg serve -p $HGPORT1 2>&1 |
|
22 | 22 | abort: cannot start server at ':$HGPORT1': * (glob) |
|
23 | 23 | [255] |
|
24 | 24 | #else |
|
25 | 25 | $ hg serve -p $HGPORT1 2>&1 |
|
26 | 26 | abort: cannot start server at ':$HGPORT1': Address already in use |
|
27 | 27 | [255] |
|
28 | 28 | #endif |
|
29 | 29 | $ cd .. |
|
30 | 30 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS |
|
31 | 31 | |
|
32 | 32 | clone via stream |
|
33 | 33 | |
|
34 | 34 | $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 |
|
35 | 35 | streaming all changes |
|
36 | 36 | 6 files to transfer, 606 bytes of data |
|
37 | 37 | transferred * bytes in * seconds (*/sec) (glob) |
|
38 | 38 | searching for changes |
|
39 | 39 | no changes found |
|
40 | 40 | updating to branch default |
|
41 | 41 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
42 | 42 | $ hg verify -R copy |
|
43 | 43 | checking changesets |
|
44 | 44 | checking manifests |
|
45 | 45 | crosschecking files in changesets and manifests |
|
46 | 46 | checking files |
|
47 | 47 | 4 files, 1 changesets, 4 total revisions |
|
48 | 48 | |
|
49 | 49 | try to clone via stream, should use pull instead |
|
50 | 50 | |
|
51 | 51 | $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2 |
|
52 | 52 | requesting all changes |
|
53 | 53 | adding changesets |
|
54 | 54 | adding manifests |
|
55 | 55 | adding file changes |
|
56 | 56 | added 1 changesets with 4 changes to 4 files |
|
57 | 57 | updating to branch default |
|
58 | 58 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
59 | 59 | |
|
60 | 60 | clone via pull |
|
61 | 61 | |
|
62 | 62 | $ hg clone http://localhost:$HGPORT1/ copy-pull |
|
63 | 63 | requesting all changes |
|
64 | 64 | adding changesets |
|
65 | 65 | adding manifests |
|
66 | 66 | adding file changes |
|
67 | 67 | added 1 changesets with 4 changes to 4 files |
|
68 | 68 | updating to branch default |
|
69 | 69 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
70 | 70 | $ hg verify -R copy-pull |
|
71 | 71 | checking changesets |
|
72 | 72 | checking manifests |
|
73 | 73 | crosschecking files in changesets and manifests |
|
74 | 74 | checking files |
|
75 | 75 | 4 files, 1 changesets, 4 total revisions |
|
76 | 76 | $ cd test |
|
77 | 77 | $ echo bar > bar |
|
78 | 78 | $ hg commit -A -d '1 0' -m 2 |
|
79 | 79 | adding bar |
|
80 | 80 | $ cd .. |
|
81 | 81 | |
|
82 | 82 | clone over http with --update |
|
83 | 83 | |
|
84 | 84 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 |
|
85 | 85 | requesting all changes |
|
86 | 86 | adding changesets |
|
87 | 87 | adding manifests |
|
88 | 88 | adding file changes |
|
89 | 89 | added 2 changesets with 5 changes to 5 files |
|
90 | 90 | updating to branch default |
|
91 | 91 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
92 | 92 | $ hg log -r . -R updated |
|
93 | 93 | changeset: 0:8b6053c928fe |
|
94 | 94 | user: test |
|
95 | 95 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
96 | 96 | summary: 1 |
|
97 | 97 | |
|
98 | 98 | $ rm -rf updated |
|
99 | 99 | |
|
100 | 100 | incoming via HTTP |
|
101 | 101 | |
|
102 | 102 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial |
|
103 | 103 | adding changesets |
|
104 | 104 | adding manifests |
|
105 | 105 | adding file changes |
|
106 | 106 | added 1 changesets with 4 changes to 4 files |
|
107 | 107 | updating to branch default |
|
108 | 108 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
109 | 109 | $ cd partial |
|
110 | 110 | $ touch LOCAL |
|
111 | 111 | $ hg ci -qAm LOCAL |
|
112 | 112 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' |
|
113 | 113 | comparing with http://localhost:$HGPORT1/ |
|
114 | 114 | searching for changes |
|
115 | 115 | 2 |
|
116 | 116 | $ cd .. |
|
117 | 117 | |
|
118 | 118 | pull |
|
119 | 119 | |
|
120 | 120 | $ cd copy-pull |
|
121 | 121 | $ cat >> .hg/hgrc <<EOF |
|
122 | 122 | > [hooks] |
|
123 | 123 | > changegroup = sh -c "printenv.py changegroup" |
|
124 | 124 | > EOF |
|
125 | 125 | $ hg pull |
|
126 | 126 | pulling from http://localhost:$HGPORT1/ |
|
127 | 127 | searching for changes |
|
128 | 128 | adding changesets |
|
129 | 129 | adding manifests |
|
130 | 130 | adding file changes |
|
131 | 131 | added 1 changesets with 1 changes to 1 files |
|
132 | 132 | changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=http://localhost:$HGPORT1/ (glob) |
|
133 | 133 | (run 'hg update' to get a working copy) |
|
134 | 134 | $ cd .. |
|
135 | 135 | |
|
136 | 136 | clone from invalid URL |
|
137 | 137 | |
|
138 | 138 | $ hg clone http://localhost:$HGPORT/bad |
|
139 | 139 | abort: HTTP Error 404: Not Found |
|
140 | 140 | [255] |
|
141 | 141 | |
|
142 | 142 | test http authentication |
|
143 | 143 | + use the same server to test server side streaming preference |
|
144 | 144 | |
|
145 | 145 | $ cd test |
|
146 | 146 | $ cat << EOT > userpass.py |
|
147 | 147 | > import base64 |
|
148 | 148 | > from mercurial.hgweb import common |
|
149 | 149 | > def perform_authentication(hgweb, req, op): |
|
150 | 150 | > auth = req.env.get('HTTP_AUTHORIZATION') |
|
151 | 151 | > if not auth: |
|
152 | 152 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', |
|
153 | 153 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) |
|
154 | 154 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: |
|
155 | 155 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') |
|
156 | 156 | > def extsetup(): |
|
157 | 157 | > common.permhooks.insert(0, perform_authentication) |
|
158 | 158 | > EOT |
|
159 | 159 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ |
|
160 | 160 | > --config server.preferuncompressed=True \ |
|
161 | 161 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log |
|
162 | 162 | $ cat pid >> $DAEMON_PIDS |
|
163 | 163 | |
|
164 | 164 | $ cat << EOF > get_pass.py |
|
165 | 165 | > import getpass |
|
166 | 166 | > def newgetpass(arg): |
|
167 | 167 | > return "pass" |
|
168 | 168 | > getpass.getpass = newgetpass |
|
169 | 169 | > EOF |
|
170 | 170 | |
|
171 | 171 | $ hg id http://localhost:$HGPORT2/ |
|
172 | 172 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
173 | 173 | [255] |
|
174 | 174 | $ hg id http://localhost:$HGPORT2/ |
|
175 | 175 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
176 | 176 | [255] |
|
177 | 177 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ |
|
178 | 178 | http authorization required for http://localhost:$HGPORT2/ |
|
179 | 179 | realm: mercurial |
|
180 | 180 | user: user |
|
181 | 181 | password: 5fed3813f7f5 |
|
182 | 182 | $ hg id http://user:pass@localhost:$HGPORT2/ |
|
183 | 183 | 5fed3813f7f5 |
|
184 | 184 | $ echo '[auth]' >> .hg/hgrc |
|
185 | 185 | $ echo 'l.schemes=http' >> .hg/hgrc |
|
186 | 186 | $ echo 'l.prefix=lo' >> .hg/hgrc |
|
187 | 187 | $ echo 'l.username=user' >> .hg/hgrc |
|
188 | 188 | $ echo 'l.password=pass' >> .hg/hgrc |
|
189 | 189 | $ hg id http://localhost:$HGPORT2/ |
|
190 | 190 | 5fed3813f7f5 |
|
191 | 191 | $ hg id http://localhost:$HGPORT2/ |
|
192 | 192 | 5fed3813f7f5 |
|
193 | 193 | $ hg id http://user@localhost:$HGPORT2/ |
|
194 | 194 | 5fed3813f7f5 |
|
195 | 195 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 |
|
196 | 196 | streaming all changes |
|
197 | 197 | 7 files to transfer, 916 bytes of data |
|
198 | 198 | transferred * bytes in * seconds (*/sec) (glob) |
|
199 | 199 | searching for changes |
|
200 | 200 | no changes found |
|
201 | 201 | updating to branch default |
|
202 | 202 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
203 | 203 | --pull should override server's preferuncompressed |
|
204 | 204 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 |
|
205 | 205 | requesting all changes |
|
206 | 206 | adding changesets |
|
207 | 207 | adding manifests |
|
208 | 208 | adding file changes |
|
209 | 209 | added 2 changesets with 5 changes to 5 files |
|
210 | 210 | updating to branch default |
|
211 | 211 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
212 | 212 | |
|
213 | 213 | $ hg id http://user2@localhost:$HGPORT2/ |
|
214 | 214 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
215 | 215 | [255] |
|
216 | 216 | $ hg id http://user:pass2@localhost:$HGPORT2/ |
|
217 | 217 | abort: HTTP Error 403: no |
|
218 | 218 | [255] |
|
219 | 219 | |
|
220 | 220 | $ hg -R dest tag -r tip top |
|
221 | 221 | $ hg -R dest push http://user:pass@localhost:$HGPORT2/ |
|
222 | 222 | pushing to http://user:***@localhost:$HGPORT2/ |
|
223 | 223 | searching for changes |
|
224 | 224 | remote: adding changesets |
|
225 | 225 | remote: adding manifests |
|
226 | 226 | remote: adding file changes |
|
227 | 227 | remote: added 1 changesets with 1 changes to 1 files |
|
228 | 228 | $ hg rollback -q |
|
229 | 229 | |
|
230 | 230 | $ sed 's/.*] "/"/' < ../access.log |
|
231 | 231 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
232 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
233 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
232 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
233 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
234 | 234 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
235 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
236 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
235 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
236 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
237 | 237 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
238 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
239 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
240 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
|
241 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
238 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
239 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
240 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
241 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
242 | 242 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
243 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
244 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
245 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
|
246 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
243 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
244 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
245 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
246 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
247 | 247 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
248 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
249 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
250 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
|
251 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
248 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
249 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
250 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
251 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
252 | 252 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
253 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
254 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
255 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
|
256 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
253 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
254 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
255 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
256 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
257 | 257 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
258 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
259 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
260 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
|
261 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
258 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
259 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
260 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
261 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
262 | 262 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
263 | "GET /?cmd=branchmap HTTP/1.1" 200 - | |
|
264 | "GET /?cmd=stream_out HTTP/1.1" 401 - | |
|
265 | "GET /?cmd=stream_out HTTP/1.1" 200 - | |
|
266 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d | |
|
267 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks | |
|
263 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
264 | "GET /?cmd=stream_out HTTP/1.1" 401 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
265 | "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
266 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
267 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
268 | 268 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
269 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D | |
|
270 | "GET /?cmd=getbundle HTTP/1.1" 401 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks | |
|
271 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks | |
|
269 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
270 | "GET /?cmd=getbundle HTTP/1.1" 401 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
271 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
272 | 272 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
273 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
274 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
273 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
274 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
275 | 275 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
276 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
|
277 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
|
278 | "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces | |
|
276 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
277 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
278 | "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
279 | 279 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
280 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 | |
|
281 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases | |
|
282 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
|
283 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
284 | "GET /?cmd=branchmap HTTP/1.1" 200 - | |
|
285 | "GET /?cmd=branchmap HTTP/1.1" 200 - | |
|
286 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
280 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
281 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
282 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
283 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
284 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
285 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
286 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
287 | 287 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob) |
|
288 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
|
288 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
289 | 289 | |
|
290 | 290 | $ cd .. |
|
291 | 291 | |
|
292 | 292 | clone of serve with repo in root and unserved subrepo (issue2970) |
|
293 | 293 | |
|
294 | 294 | $ hg --cwd test init sub |
|
295 | 295 | $ echo empty > test/sub/empty |
|
296 | 296 | $ hg --cwd test/sub add empty |
|
297 | 297 | $ hg --cwd test/sub commit -qm 'add empty' |
|
298 | 298 | $ hg --cwd test/sub tag -r 0 something |
|
299 | 299 | $ echo sub = sub > test/.hgsub |
|
300 | 300 | $ hg --cwd test add .hgsub |
|
301 | 301 | $ hg --cwd test commit -qm 'add subrepo' |
|
302 | 302 | $ hg clone http://localhost:$HGPORT noslash-clone |
|
303 | 303 | requesting all changes |
|
304 | 304 | adding changesets |
|
305 | 305 | adding manifests |
|
306 | 306 | adding file changes |
|
307 | 307 | added 3 changesets with 7 changes to 7 files |
|
308 | 308 | updating to branch default |
|
309 | 309 | abort: HTTP Error 404: Not Found |
|
310 | 310 | [255] |
|
311 | 311 | $ hg clone http://localhost:$HGPORT/ slash-clone |
|
312 | 312 | requesting all changes |
|
313 | 313 | adding changesets |
|
314 | 314 | adding manifests |
|
315 | 315 | adding file changes |
|
316 | 316 | added 3 changesets with 7 changes to 7 files |
|
317 | 317 | updating to branch default |
|
318 | 318 | abort: HTTP Error 404: Not Found |
|
319 | 319 | [255] |
|
320 | 320 | |
|
321 | 321 | check error log |
|
322 | 322 | |
|
323 | 323 | $ cat error.log |
@@ -1,447 +1,447 b'' | |||
|
1 | 1 | This file contains testcases that tend to be related to the wire protocol part |
|
2 | 2 | of largefiles. |
|
3 | 3 | |
|
4 | 4 | $ USERCACHE="$TESTTMP/cache"; export USERCACHE |
|
5 | 5 | $ mkdir "${USERCACHE}" |
|
6 | 6 | $ cat >> $HGRCPATH <<EOF |
|
7 | 7 | > [extensions] |
|
8 | 8 | > largefiles= |
|
9 | 9 | > purge= |
|
10 | 10 | > rebase= |
|
11 | 11 | > transplant= |
|
12 | 12 | > [phases] |
|
13 | 13 | > publish=False |
|
14 | 14 | > [largefiles] |
|
15 | 15 | > minsize=2 |
|
16 | 16 | > patterns=glob:**.dat |
|
17 | 17 | > usercache=${USERCACHE} |
|
18 | 18 | > [web] |
|
19 | 19 | > allow_archive = zip |
|
20 | 20 | > [hooks] |
|
21 | 21 | > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status" |
|
22 | 22 | > EOF |
|
23 | 23 | |
|
24 | 24 | |
|
25 | 25 | #if serve |
|
26 | 26 | vanilla clients not locked out from largefiles servers on vanilla repos |
|
27 | 27 | $ mkdir r1 |
|
28 | 28 | $ cd r1 |
|
29 | 29 | $ hg init |
|
30 | 30 | $ echo c1 > f1 |
|
31 | 31 | $ hg add f1 |
|
32 | 32 | $ hg commit -m "m1" |
|
33 | 33 | Invoking status precommit hook |
|
34 | 34 | A f1 |
|
35 | 35 | $ cd .. |
|
36 | 36 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid |
|
37 | 37 | $ cat hg.pid >> $DAEMON_PIDS |
|
38 | 38 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 |
|
39 | 39 | requesting all changes |
|
40 | 40 | adding changesets |
|
41 | 41 | adding manifests |
|
42 | 42 | adding file changes |
|
43 | 43 | added 1 changesets with 1 changes to 1 files |
|
44 | 44 | updating to branch default |
|
45 | 45 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
46 | 46 | |
|
47 | 47 | largefiles clients still work with vanilla servers |
|
48 | 48 | $ hg serve --config extensions.largefiles=! -R r1 -d -p $HGPORT1 --pid-file hg.pid |
|
49 | 49 | $ cat hg.pid >> $DAEMON_PIDS |
|
50 | 50 | $ hg clone http://localhost:$HGPORT1 r3 |
|
51 | 51 | requesting all changes |
|
52 | 52 | adding changesets |
|
53 | 53 | adding manifests |
|
54 | 54 | adding file changes |
|
55 | 55 | added 1 changesets with 1 changes to 1 files |
|
56 | 56 | updating to branch default |
|
57 | 57 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
58 | 58 | #endif |
|
59 | 59 | |
|
60 | 60 | vanilla clients locked out from largefiles http repos |
|
61 | 61 | $ mkdir r4 |
|
62 | 62 | $ cd r4 |
|
63 | 63 | $ hg init |
|
64 | 64 | $ echo c1 > f1 |
|
65 | 65 | $ hg add --large f1 |
|
66 | 66 | $ hg commit -m "m1" |
|
67 | 67 | Invoking status precommit hook |
|
68 | 68 | A f1 |
|
69 | 69 | $ cd .. |
|
70 | 70 | |
|
71 | 71 | largefiles can be pushed locally (issue3583) |
|
72 | 72 | $ hg init dest |
|
73 | 73 | $ cd r4 |
|
74 | 74 | $ hg outgoing ../dest |
|
75 | 75 | comparing with ../dest |
|
76 | 76 | searching for changes |
|
77 | 77 | changeset: 0:639881c12b4c |
|
78 | 78 | tag: tip |
|
79 | 79 | user: test |
|
80 | 80 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
81 | 81 | summary: m1 |
|
82 | 82 | |
|
83 | 83 | $ hg push ../dest |
|
84 | 84 | pushing to ../dest |
|
85 | 85 | searching for changes |
|
86 | 86 | adding changesets |
|
87 | 87 | adding manifests |
|
88 | 88 | adding file changes |
|
89 | 89 | added 1 changesets with 1 changes to 1 files |
|
90 | 90 | |
|
91 | 91 | exit code with nothing outgoing (issue3611) |
|
92 | 92 | $ hg outgoing ../dest |
|
93 | 93 | comparing with ../dest |
|
94 | 94 | searching for changes |
|
95 | 95 | no changes found |
|
96 | 96 | [1] |
|
97 | 97 | $ cd .. |
|
98 | 98 | |
|
99 | 99 | #if serve |
|
100 | 100 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid |
|
101 | 101 | $ cat hg.pid >> $DAEMON_PIDS |
|
102 | 102 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 |
|
103 | 103 | abort: remote error: |
|
104 | 104 | |
|
105 | 105 | This repository uses the largefiles extension. |
|
106 | 106 | |
|
107 | 107 | Please enable it in your Mercurial config file. |
|
108 | 108 | [255] |
|
109 | 109 | |
|
110 | 110 | used all HGPORTs, kill all daemons |
|
111 | 111 | $ killdaemons.py |
|
112 | 112 | #endif |
|
113 | 113 | |
|
114 | 114 | vanilla clients locked out from largefiles ssh repos |
|
115 | 115 | $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5 |
|
116 | 116 | remote: |
|
117 | 117 | remote: This repository uses the largefiles extension. |
|
118 | 118 | remote: |
|
119 | 119 | remote: Please enable it in your Mercurial config file. |
|
120 | 120 | remote: |
|
121 | 121 | remote: - |
|
122 | 122 | abort: remote error |
|
123 | 123 | (check previous remote output) |
|
124 | 124 | [255] |
|
125 | 125 | |
|
126 | 126 | #if serve |
|
127 | 127 | |
|
128 | 128 | largefiles clients refuse to push largefiles repos to vanilla servers |
|
129 | 129 | $ mkdir r6 |
|
130 | 130 | $ cd r6 |
|
131 | 131 | $ hg init |
|
132 | 132 | $ echo c1 > f1 |
|
133 | 133 | $ hg add f1 |
|
134 | 134 | $ hg commit -m "m1" |
|
135 | 135 | Invoking status precommit hook |
|
136 | 136 | A f1 |
|
137 | 137 | $ cat >> .hg/hgrc <<! |
|
138 | 138 | > [web] |
|
139 | 139 | > push_ssl = false |
|
140 | 140 | > allow_push = * |
|
141 | 141 | > ! |
|
142 | 142 | $ cd .. |
|
143 | 143 | $ hg clone r6 r7 |
|
144 | 144 | updating to branch default |
|
145 | 145 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
146 | 146 | $ cd r7 |
|
147 | 147 | $ echo c2 > f2 |
|
148 | 148 | $ hg add --large f2 |
|
149 | 149 | $ hg commit -m "m2" |
|
150 | 150 | Invoking status precommit hook |
|
151 | 151 | A f2 |
|
152 | 152 | $ hg verify --large |
|
153 | 153 | checking changesets |
|
154 | 154 | checking manifests |
|
155 | 155 | crosschecking files in changesets and manifests |
|
156 | 156 | checking files |
|
157 | 157 | 2 files, 2 changesets, 2 total revisions |
|
158 | 158 | searching 1 changesets for largefiles |
|
159 | 159 | verified existence of 1 revisions of 1 largefiles |
|
160 | 160 | $ hg serve --config extensions.largefiles=! -R ../r6 -d -p $HGPORT --pid-file ../hg.pid |
|
161 | 161 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
162 | 162 | $ hg push http://localhost:$HGPORT |
|
163 | 163 | pushing to http://localhost:$HGPORT/ |
|
164 | 164 | searching for changes |
|
165 | 165 | abort: http://localhost:$HGPORT/ does not appear to be a largefile store |
|
166 | 166 | [255] |
|
167 | 167 | $ cd .. |
|
168 | 168 | |
|
169 | 169 | putlfile errors are shown (issue3123) |
|
170 | 170 | Corrupt the cached largefile in r7 and move it out of the servers usercache |
|
171 | 171 | $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 . |
|
172 | 172 | $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
173 | 173 | $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8" |
|
174 | 174 | $ hg init empty |
|
175 | 175 | $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \ |
|
176 | 176 | > --config 'web.allow_push=*' --config web.push_ssl=False |
|
177 | 177 | $ cat hg.pid >> $DAEMON_PIDS |
|
178 | 178 | $ hg push -R r7 http://localhost:$HGPORT1 |
|
179 | 179 | pushing to http://localhost:$HGPORT1/ |
|
180 | 180 | searching for changes |
|
181 | 181 | remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash |
|
182 | 182 | abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob) |
|
183 | 183 | [255] |
|
184 | 184 | $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
185 | 185 | Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic |
|
186 | 186 | $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
187 | 187 | $ hg push -R r7 http://localhost:$HGPORT1 |
|
188 | 188 | pushing to http://localhost:$HGPORT1/ |
|
189 | 189 | searching for changes |
|
190 | 190 | remote: adding changesets |
|
191 | 191 | remote: adding manifests |
|
192 | 192 | remote: adding file changes |
|
193 | 193 | remote: added 2 changesets with 2 changes to 2 files |
|
194 | 194 | $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
195 | 195 | server side corruption |
|
196 | 196 | $ rm -rf empty |
|
197 | 197 | |
|
198 | 198 | Push a largefiles repository to a served empty repository |
|
199 | 199 | $ hg init r8 |
|
200 | 200 | $ echo c3 > r8/f1 |
|
201 | 201 | $ hg add --large r8/f1 -R r8 |
|
202 | 202 | $ hg commit -m "m1" -R r8 |
|
203 | 203 | Invoking status precommit hook |
|
204 | 204 | A f1 |
|
205 | 205 | $ hg init empty |
|
206 | 206 | $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \ |
|
207 | 207 | > --config 'web.allow_push=*' --config web.push_ssl=False |
|
208 | 208 | $ cat hg.pid >> $DAEMON_PIDS |
|
209 | 209 | $ rm "${USERCACHE}"/* |
|
210 | 210 | $ hg push -R r8 http://localhost:$HGPORT2/#default |
|
211 | 211 | pushing to http://localhost:$HGPORT2/ |
|
212 | 212 | searching for changes |
|
213 | 213 | remote: adding changesets |
|
214 | 214 | remote: adding manifests |
|
215 | 215 | remote: adding file changes |
|
216 | 216 | remote: added 1 changesets with 1 changes to 1 files |
|
217 | 217 | $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] |
|
218 | 218 | $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] |
|
219 | 219 | |
|
220 | 220 | Clone over http, no largefiles pulled on clone. |
|
221 | 221 | |
|
222 | 222 | $ hg clone http://localhost:$HGPORT2/#default http-clone -U |
|
223 | 223 | adding changesets |
|
224 | 224 | adding manifests |
|
225 | 225 | adding file changes |
|
226 | 226 | added 1 changesets with 1 changes to 1 files |
|
227 | 227 | |
|
228 | 228 | Archive contains largefiles |
|
229 | 229 | >>> import urllib2, os |
|
230 | 230 | >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2'] |
|
231 | 231 | >>> with open('archive.zip', 'w') as f: |
|
232 | 232 | ... f.write(urllib2.urlopen(u).read()) |
|
233 | 233 | $ unzip -t archive.zip |
|
234 | 234 | Archive: archive.zip |
|
235 | 235 | testing: empty-default/.hg_archival.txt*OK (glob) |
|
236 | 236 | testing: empty-default/f1*OK (glob) |
|
237 | 237 | No errors detected in compressed data of archive.zip. |
|
238 | 238 | |
|
239 | 239 | test 'verify' with remotestore: |
|
240 | 240 | |
|
241 | 241 | $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 |
|
242 | 242 | $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 . |
|
243 | 243 | $ hg -R http-clone verify --large --lfa |
|
244 | 244 | checking changesets |
|
245 | 245 | checking manifests |
|
246 | 246 | crosschecking files in changesets and manifests |
|
247 | 247 | checking files |
|
248 | 248 | 1 files, 1 changesets, 1 total revisions |
|
249 | 249 | searching 1 changesets for largefiles |
|
250 | 250 | changeset 0:cf03e5bb9936: f1 missing |
|
251 | 251 | verified existence of 1 revisions of 1 largefiles |
|
252 | 252 | [1] |
|
253 | 253 | $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/ |
|
254 | 254 | $ hg -R http-clone -q verify --large --lfa |
|
255 | 255 | |
|
256 | 256 | largefiles pulled on update - a largefile missing on the server: |
|
257 | 257 | $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 . |
|
258 | 258 | $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache |
|
259 | 259 | getting changed largefiles |
|
260 | 260 | f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/ |
|
261 | 261 | 0 largefiles updated, 0 removed |
|
262 | 262 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
263 | 263 | $ hg -R http-clone st |
|
264 | 264 | ! f1 |
|
265 | 265 | $ hg -R http-clone up -Cqr null |
|
266 | 266 | |
|
267 | 267 | largefiles pulled on update - a largefile corrupted on the server: |
|
268 | 268 | $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 |
|
269 | 269 | $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache |
|
270 | 270 | getting changed largefiles |
|
271 | 271 | f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27) |
|
272 | 272 | 0 largefiles updated, 0 removed |
|
273 | 273 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
274 | 274 | $ hg -R http-clone st |
|
275 | 275 | ! f1 |
|
276 | 276 | $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] |
|
277 | 277 | $ [ ! -f http-clone/f1 ] |
|
278 | 278 | $ [ ! -f http-clone-usercache ] |
|
279 | 279 | $ hg -R http-clone verify --large --lfc |
|
280 | 280 | checking changesets |
|
281 | 281 | checking manifests |
|
282 | 282 | crosschecking files in changesets and manifests |
|
283 | 283 | checking files |
|
284 | 284 | 1 files, 1 changesets, 1 total revisions |
|
285 | 285 | searching 1 changesets for largefiles |
|
286 | 286 | verified contents of 1 revisions of 1 largefiles |
|
287 | 287 | $ hg -R http-clone up -Cqr null |
|
288 | 288 | |
|
289 | 289 | largefiles pulled on update - no server side problems: |
|
290 | 290 | $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/ |
|
291 | 291 | $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache --config progress.debug=true |
|
292 | 292 | resolving manifests |
|
293 | 293 | branchmerge: False, force: False, partial: False |
|
294 | 294 | ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936 |
|
295 | 295 | .hglf/f1: remote created -> g |
|
296 | 296 | getting .hglf/f1 |
|
297 | 297 | updating: .hglf/f1 1/1 files (100.00%) |
|
298 | 298 | getting changed largefiles |
|
299 | 299 | using http://localhost:$HGPORT2/ |
|
300 | 300 | sending capabilities command |
|
301 | 301 | sending batch command |
|
302 | 302 | getting largefiles: 0/1 files (0.00%) |
|
303 | 303 | getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90 |
|
304 | 304 | sending getlfile command |
|
305 | 305 | found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store |
|
306 | 306 | 1 largefiles updated, 0 removed |
|
307 | 307 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
308 | 308 | |
|
309 | 309 | $ ls http-clone-usercache/* |
|
310 | 310 | http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90 |
|
311 | 311 | |
|
312 | 312 | $ rm -rf empty http-clone* |
|
313 | 313 | |
|
314 | 314 | used all HGPORTs, kill all daemons |
|
315 | 315 | $ killdaemons.py |
|
316 | 316 | |
|
317 | 317 | largefiles should batch verify remote calls |
|
318 | 318 | |
|
319 | 319 | $ hg init batchverifymain |
|
320 | 320 | $ cd batchverifymain |
|
321 | 321 | $ echo "aaa" >> a |
|
322 | 322 | $ hg add --large a |
|
323 | 323 | $ hg commit -m "a" |
|
324 | 324 | Invoking status precommit hook |
|
325 | 325 | A a |
|
326 | 326 | $ echo "bbb" >> b |
|
327 | 327 | $ hg add --large b |
|
328 | 328 | $ hg commit -m "b" |
|
329 | 329 | Invoking status precommit hook |
|
330 | 330 | A b |
|
331 | 331 | $ cd .. |
|
332 | 332 | $ hg serve -R batchverifymain -d -p $HGPORT --pid-file hg.pid \ |
|
333 | 333 | > -A access.log |
|
334 | 334 | $ cat hg.pid >> $DAEMON_PIDS |
|
335 | 335 | $ hg clone --noupdate http://localhost:$HGPORT batchverifyclone |
|
336 | 336 | requesting all changes |
|
337 | 337 | adding changesets |
|
338 | 338 | adding manifests |
|
339 | 339 | adding file changes |
|
340 | 340 | added 2 changesets with 2 changes to 2 files |
|
341 | 341 | $ hg -R batchverifyclone verify --large --lfa |
|
342 | 342 | checking changesets |
|
343 | 343 | checking manifests |
|
344 | 344 | crosschecking files in changesets and manifests |
|
345 | 345 | checking files |
|
346 | 346 | 2 files, 2 changesets, 2 total revisions |
|
347 | 347 | searching 2 changesets for largefiles |
|
348 | 348 | verified existence of 2 revisions of 2 largefiles |
|
349 | 349 | $ tail -1 access.log |
|
350 | 127.0.0.1 - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a (glob) | |
|
350 | 127.0.0.1 - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
351 | 351 |
$ |
|
352 | 352 | getting changed largefiles |
|
353 | 353 | 2 largefiles updated, 0 removed |
|
354 | 354 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
355 | 355 | |
|
356 | 356 | Clear log file before next test |
|
357 | 357 | |
|
358 | 358 | $ printf "" > access.log |
|
359 | 359 | |
|
360 | 360 | Verify should check file on remote server only when file is not |
|
361 | 361 | available locally. |
|
362 | 362 | |
|
363 | 363 | $ echo "ccc" >> batchverifymain/c |
|
364 | 364 | $ hg -R batchverifymain status |
|
365 | 365 | ? c |
|
366 | 366 | $ hg -R batchverifymain add --large batchverifymain/c |
|
367 | 367 | $ hg -R batchverifymain commit -m "c" |
|
368 | 368 | Invoking status precommit hook |
|
369 | 369 | A c |
|
370 | 370 | $ hg -R batchverifyclone pull |
|
371 | 371 | pulling from http://localhost:$HGPORT/ |
|
372 | 372 | searching for changes |
|
373 | 373 | adding changesets |
|
374 | 374 | adding manifests |
|
375 | 375 | adding file changes |
|
376 | 376 | added 1 changesets with 1 changes to 1 files |
|
377 | 377 | (run 'hg update' to get a working copy) |
|
378 | 378 | $ hg -R batchverifyclone verify --lfa |
|
379 | 379 | checking changesets |
|
380 | 380 | checking manifests |
|
381 | 381 | crosschecking files in changesets and manifests |
|
382 | 382 | checking files |
|
383 | 383 | 3 files, 3 changesets, 3 total revisions |
|
384 | 384 | searching 3 changesets for largefiles |
|
385 | 385 | verified existence of 3 revisions of 3 largefiles |
|
386 | 386 | $ tail -1 access.log |
|
387 | 127.0.0.1 - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3Dc8559c3c9cfb42131794b7d8009230403b9b454c (glob) | |
|
387 | 127.0.0.1 - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3Dc8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
388 | 388 | |
|
389 | 389 |
$ |
|
390 | 390 | |
|
391 | 391 | largefiles should not ask for password again after successful authorization |
|
392 | 392 | |
|
393 | 393 | $ hg init credentialmain |
|
394 | 394 | $ cd credentialmain |
|
395 | 395 | $ echo "aaa" >> a |
|
396 | 396 | $ hg add --large a |
|
397 | 397 | $ hg commit -m "a" |
|
398 | 398 | Invoking status precommit hook |
|
399 | 399 | A a |
|
400 | 400 | |
|
401 | 401 | Before running server clear the user cache to force clone to download |
|
402 | 402 | a large file from the server rather than to get it from the cache |
|
403 | 403 | |
|
404 | 404 | $ rm "${USERCACHE}"/* |
|
405 | 405 | |
|
406 | 406 | $ cd .. |
|
407 | 407 | $ cat << EOT > userpass.py |
|
408 | 408 | > import base64 |
|
409 | 409 | > from mercurial.hgweb import common |
|
410 | 410 | > def perform_authentication(hgweb, req, op): |
|
411 | 411 | > auth = req.env.get('HTTP_AUTHORIZATION') |
|
412 | 412 | > if not auth: |
|
413 | 413 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', |
|
414 | 414 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) |
|
415 | 415 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: |
|
416 | 416 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') |
|
417 | 417 | > def extsetup(): |
|
418 | 418 | > common.permhooks.insert(0, perform_authentication) |
|
419 | 419 | > EOT |
|
420 | 420 | $ hg serve --config extensions.x=userpass.py -R credentialmain \ |
|
421 | 421 | > -d -p $HGPORT --pid-file hg.pid -A access.log |
|
422 | 422 | $ cat hg.pid >> $DAEMON_PIDS |
|
423 | 423 | $ cat << EOF > get_pass.py |
|
424 | 424 | > import getpass |
|
425 | 425 | > def newgetpass(arg): |
|
426 | 426 | > return "pass" |
|
427 | 427 | > getpass.getpass = newgetpass |
|
428 | 428 | > EOF |
|
429 | 429 | $ hg clone --config ui.interactive=true --config extensions.getpass=get_pass.py \ |
|
430 | 430 | > http://user@localhost:$HGPORT credentialclone |
|
431 | 431 | requesting all changes |
|
432 | 432 | http authorization required for http://localhost:$HGPORT/ |
|
433 | 433 | realm: mercurial |
|
434 | 434 | user: user |
|
435 | 435 | password: adding changesets |
|
436 | 436 | adding manifests |
|
437 | 437 | adding file changes |
|
438 | 438 | added 1 changesets with 1 changes to 1 files |
|
439 | 439 | updating to branch default |
|
440 | 440 | getting changed largefiles |
|
441 | 441 | 1 largefiles updated, 0 removed |
|
442 | 442 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
443 | 443 | |
|
444 | 444 | $ rm hg.pid access.log |
|
445 | 445 | $ killdaemons.py |
|
446 | 446 | |
|
447 | 447 | #endif |
@@ -1,406 +1,406 b'' | |||
|
1 | 1 | |
|
2 | 2 | Function to test discovery between two repos in both directions, using both the local shortcut |
|
3 | 3 | (which is currently not activated by default) and the full remotable protocol: |
|
4 | 4 | |
|
5 | 5 | $ testdesc() { # revs_a, revs_b, dagdesc |
|
6 | 6 | > if [ -d foo ]; then rm -rf foo; fi |
|
7 | 7 | > hg init foo |
|
8 | 8 | > cd foo |
|
9 | 9 | > hg debugbuilddag "$3" |
|
10 | 10 | > hg clone . a $1 --quiet |
|
11 | 11 | > hg clone . b $2 --quiet |
|
12 | 12 | > echo |
|
13 | 13 | > echo "% -- a -> b tree" |
|
14 | 14 | > hg -R a debugdiscovery b --verbose --old |
|
15 | 15 | > echo |
|
16 | 16 | > echo "% -- a -> b set" |
|
17 | 17 | > hg -R a debugdiscovery b --verbose --debug --config progress.debug=true |
|
18 | 18 | > echo |
|
19 | 19 | > echo "% -- b -> a tree" |
|
20 | 20 | > hg -R b debugdiscovery a --verbose --old --config |
|
21 | 21 | > echo |
|
22 | 22 | > echo "% -- b -> a set" |
|
23 | 23 | > hg -R b debugdiscovery a --verbose --debug --config progress.debug=true |
|
24 | 24 | > cd .. |
|
25 | 25 | > } |
|
26 | 26 | |
|
27 | 27 | |
|
28 | 28 | Small superset: |
|
29 | 29 | |
|
30 | 30 | $ testdesc '-ra1 -ra2' '-rb1 -rb2 -rb3' ' |
|
31 | 31 | > +2:f +1:a1:b1 |
|
32 | 32 | > <f +4 :a2 |
|
33 | 33 | > +5 :b2 |
|
34 | 34 | > <f +3 :b3' |
|
35 | 35 | |
|
36 | 36 | % -- a -> b tree |
|
37 | 37 | comparing with b |
|
38 | 38 | searching for changes |
|
39 | 39 | unpruned common: 01241442b3c2 66f7d451a68b b5714e113bc0 |
|
40 | 40 | common heads: 01241442b3c2 b5714e113bc0 |
|
41 | 41 | local is subset |
|
42 | 42 | |
|
43 | 43 | % -- a -> b set |
|
44 | 44 | comparing with b |
|
45 | 45 | query 1; heads |
|
46 | 46 | searching for changes |
|
47 | 47 | all local heads known remotely |
|
48 | 48 | common heads: 01241442b3c2 b5714e113bc0 |
|
49 | 49 | local is subset |
|
50 | 50 | |
|
51 | 51 | % -- b -> a tree |
|
52 | 52 | comparing with a |
|
53 | 53 | searching for changes |
|
54 | 54 | unpruned common: 01241442b3c2 b5714e113bc0 |
|
55 | 55 | common heads: 01241442b3c2 b5714e113bc0 |
|
56 | 56 | remote is subset |
|
57 | 57 | |
|
58 | 58 | % -- b -> a set |
|
59 | 59 | comparing with a |
|
60 | 60 | query 1; heads |
|
61 | 61 | searching for changes |
|
62 | 62 | all remote heads known locally |
|
63 | 63 | common heads: 01241442b3c2 b5714e113bc0 |
|
64 | 64 | remote is subset |
|
65 | 65 | |
|
66 | 66 | |
|
67 | 67 | Many new: |
|
68 | 68 | |
|
69 | 69 | $ testdesc '-ra1 -ra2' '-rb' ' |
|
70 | 70 | > +2:f +3:a1 +3:b |
|
71 | 71 | > <f +30 :a2' |
|
72 | 72 | |
|
73 | 73 | % -- a -> b tree |
|
74 | 74 | comparing with b |
|
75 | 75 | searching for changes |
|
76 | 76 | unpruned common: bebd167eb94d |
|
77 | 77 | common heads: bebd167eb94d |
|
78 | 78 | |
|
79 | 79 | % -- a -> b set |
|
80 | 80 | comparing with b |
|
81 | 81 | query 1; heads |
|
82 | 82 | searching for changes |
|
83 | 83 | taking initial sample |
|
84 | 84 | searching: 2 queries |
|
85 | 85 | query 2; still undecided: 29, sample size is: 29 |
|
86 | 86 | 2 total queries |
|
87 | 87 | common heads: bebd167eb94d |
|
88 | 88 | |
|
89 | 89 | % -- b -> a tree |
|
90 | 90 | comparing with a |
|
91 | 91 | searching for changes |
|
92 | 92 | unpruned common: 66f7d451a68b bebd167eb94d |
|
93 | 93 | common heads: bebd167eb94d |
|
94 | 94 | |
|
95 | 95 | % -- b -> a set |
|
96 | 96 | comparing with a |
|
97 | 97 | query 1; heads |
|
98 | 98 | searching for changes |
|
99 | 99 | taking initial sample |
|
100 | 100 | searching: 2 queries |
|
101 | 101 | query 2; still undecided: 2, sample size is: 2 |
|
102 | 102 | 2 total queries |
|
103 | 103 | common heads: bebd167eb94d |
|
104 | 104 | |
|
105 | 105 | |
|
106 | 106 | Both sides many new with stub: |
|
107 | 107 | |
|
108 | 108 | $ testdesc '-ra1 -ra2' '-rb' ' |
|
109 | 109 | > +2:f +2:a1 +30 :b |
|
110 | 110 | > <f +30 :a2' |
|
111 | 111 | |
|
112 | 112 | % -- a -> b tree |
|
113 | 113 | comparing with b |
|
114 | 114 | searching for changes |
|
115 | 115 | unpruned common: 2dc09a01254d |
|
116 | 116 | common heads: 2dc09a01254d |
|
117 | 117 | |
|
118 | 118 | % -- a -> b set |
|
119 | 119 | comparing with b |
|
120 | 120 | query 1; heads |
|
121 | 121 | searching for changes |
|
122 | 122 | taking initial sample |
|
123 | 123 | searching: 2 queries |
|
124 | 124 | query 2; still undecided: 29, sample size is: 29 |
|
125 | 125 | 2 total queries |
|
126 | 126 | common heads: 2dc09a01254d |
|
127 | 127 | |
|
128 | 128 | % -- b -> a tree |
|
129 | 129 | comparing with a |
|
130 | 130 | searching for changes |
|
131 | 131 | unpruned common: 2dc09a01254d 66f7d451a68b |
|
132 | 132 | common heads: 2dc09a01254d |
|
133 | 133 | |
|
134 | 134 | % -- b -> a set |
|
135 | 135 | comparing with a |
|
136 | 136 | query 1; heads |
|
137 | 137 | searching for changes |
|
138 | 138 | taking initial sample |
|
139 | 139 | searching: 2 queries |
|
140 | 140 | query 2; still undecided: 29, sample size is: 29 |
|
141 | 141 | 2 total queries |
|
142 | 142 | common heads: 2dc09a01254d |
|
143 | 143 | |
|
144 | 144 | |
|
145 | 145 | Both many new: |
|
146 | 146 | |
|
147 | 147 | $ testdesc '-ra' '-rb' ' |
|
148 | 148 | > +2:f +30 :b |
|
149 | 149 | > <f +30 :a' |
|
150 | 150 | |
|
151 | 151 | % -- a -> b tree |
|
152 | 152 | comparing with b |
|
153 | 153 | searching for changes |
|
154 | 154 | unpruned common: 66f7d451a68b |
|
155 | 155 | common heads: 66f7d451a68b |
|
156 | 156 | |
|
157 | 157 | % -- a -> b set |
|
158 | 158 | comparing with b |
|
159 | 159 | query 1; heads |
|
160 | 160 | searching for changes |
|
161 | 161 | taking quick initial sample |
|
162 | 162 | searching: 2 queries |
|
163 | 163 | query 2; still undecided: 31, sample size is: 31 |
|
164 | 164 | 2 total queries |
|
165 | 165 | common heads: 66f7d451a68b |
|
166 | 166 | |
|
167 | 167 | % -- b -> a tree |
|
168 | 168 | comparing with a |
|
169 | 169 | searching for changes |
|
170 | 170 | unpruned common: 66f7d451a68b |
|
171 | 171 | common heads: 66f7d451a68b |
|
172 | 172 | |
|
173 | 173 | % -- b -> a set |
|
174 | 174 | comparing with a |
|
175 | 175 | query 1; heads |
|
176 | 176 | searching for changes |
|
177 | 177 | taking quick initial sample |
|
178 | 178 | searching: 2 queries |
|
179 | 179 | query 2; still undecided: 31, sample size is: 31 |
|
180 | 180 | 2 total queries |
|
181 | 181 | common heads: 66f7d451a68b |
|
182 | 182 | |
|
183 | 183 | |
|
184 | 184 | Both many new skewed: |
|
185 | 185 | |
|
186 | 186 | $ testdesc '-ra' '-rb' ' |
|
187 | 187 | > +2:f +30 :b |
|
188 | 188 | > <f +50 :a' |
|
189 | 189 | |
|
190 | 190 | % -- a -> b tree |
|
191 | 191 | comparing with b |
|
192 | 192 | searching for changes |
|
193 | 193 | unpruned common: 66f7d451a68b |
|
194 | 194 | common heads: 66f7d451a68b |
|
195 | 195 | |
|
196 | 196 | % -- a -> b set |
|
197 | 197 | comparing with b |
|
198 | 198 | query 1; heads |
|
199 | 199 | searching for changes |
|
200 | 200 | taking quick initial sample |
|
201 | 201 | searching: 2 queries |
|
202 | 202 | query 2; still undecided: 51, sample size is: 51 |
|
203 | 203 | 2 total queries |
|
204 | 204 | common heads: 66f7d451a68b |
|
205 | 205 | |
|
206 | 206 | % -- b -> a tree |
|
207 | 207 | comparing with a |
|
208 | 208 | searching for changes |
|
209 | 209 | unpruned common: 66f7d451a68b |
|
210 | 210 | common heads: 66f7d451a68b |
|
211 | 211 | |
|
212 | 212 | % -- b -> a set |
|
213 | 213 | comparing with a |
|
214 | 214 | query 1; heads |
|
215 | 215 | searching for changes |
|
216 | 216 | taking quick initial sample |
|
217 | 217 | searching: 2 queries |
|
218 | 218 | query 2; still undecided: 31, sample size is: 31 |
|
219 | 219 | 2 total queries |
|
220 | 220 | common heads: 66f7d451a68b |
|
221 | 221 | |
|
222 | 222 | |
|
223 | 223 | Both many new on top of long history: |
|
224 | 224 | |
|
225 | 225 | $ testdesc '-ra' '-rb' ' |
|
226 | 226 | > +1000:f +30 :b |
|
227 | 227 | > <f +50 :a' |
|
228 | 228 | |
|
229 | 229 | % -- a -> b tree |
|
230 | 230 | comparing with b |
|
231 | 231 | searching for changes |
|
232 | 232 | unpruned common: 7ead0cba2838 |
|
233 | 233 | common heads: 7ead0cba2838 |
|
234 | 234 | |
|
235 | 235 | % -- a -> b set |
|
236 | 236 | comparing with b |
|
237 | 237 | query 1; heads |
|
238 | 238 | searching for changes |
|
239 | 239 | taking quick initial sample |
|
240 | 240 | searching: 2 queries |
|
241 | 241 | query 2; still undecided: 1049, sample size is: 11 |
|
242 | 242 | sampling from both directions |
|
243 | 243 | searching: 3 queries |
|
244 | 244 | query 3; still undecided: 31, sample size is: 31 |
|
245 | 245 | 3 total queries |
|
246 | 246 | common heads: 7ead0cba2838 |
|
247 | 247 | |
|
248 | 248 | % -- b -> a tree |
|
249 | 249 | comparing with a |
|
250 | 250 | searching for changes |
|
251 | 251 | unpruned common: 7ead0cba2838 |
|
252 | 252 | common heads: 7ead0cba2838 |
|
253 | 253 | |
|
254 | 254 | % -- b -> a set |
|
255 | 255 | comparing with a |
|
256 | 256 | query 1; heads |
|
257 | 257 | searching for changes |
|
258 | 258 | taking quick initial sample |
|
259 | 259 | searching: 2 queries |
|
260 | 260 | query 2; still undecided: 1029, sample size is: 11 |
|
261 | 261 | sampling from both directions |
|
262 | 262 | searching: 3 queries |
|
263 | 263 | query 3; still undecided: 15, sample size is: 15 |
|
264 | 264 | 3 total queries |
|
265 | 265 | common heads: 7ead0cba2838 |
|
266 | 266 | |
|
267 | 267 | |
|
268 | 268 | One with >200 heads, which used to use up all of the sample: |
|
269 | 269 | |
|
270 | 270 | $ hg init manyheads |
|
271 | 271 | $ cd manyheads |
|
272 | 272 | $ echo "+300:r @a" >dagdesc |
|
273 | 273 | $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads |
|
274 | 274 | $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads |
|
275 | 275 | $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads |
|
276 | 276 | $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads |
|
277 | 277 | $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads |
|
278 | 278 | $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads |
|
279 | 279 | $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads |
|
280 | 280 | $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads |
|
281 | 281 | $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads |
|
282 | 282 | $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads |
|
283 | 283 | $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads |
|
284 | 284 | $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads |
|
285 | 285 | $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads |
|
286 | 286 | $ echo "@b *r+3" >>dagdesc # one more head |
|
287 | 287 | $ hg debugbuilddag <dagdesc |
|
288 | 288 | reading DAG from stdin |
|
289 | 289 | |
|
290 | 290 | $ hg heads -t --template . | wc -c |
|
291 | 291 | \s*261 (re) |
|
292 | 292 | |
|
293 | 293 | $ hg clone -b a . a |
|
294 | 294 | adding changesets |
|
295 | 295 | adding manifests |
|
296 | 296 | adding file changes |
|
297 | 297 | added 1340 changesets with 0 changes to 0 files (+259 heads) |
|
298 | 298 | updating to branch a |
|
299 | 299 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
300 | 300 | $ hg clone -b b . b |
|
301 | 301 | adding changesets |
|
302 | 302 | adding manifests |
|
303 | 303 | adding file changes |
|
304 | 304 | added 304 changesets with 0 changes to 0 files |
|
305 | 305 | updating to branch b |
|
306 | 306 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
307 | 307 | |
|
308 | 308 | $ hg -R a debugdiscovery b --debug --verbose --config progress.debug=true |
|
309 | 309 | comparing with b |
|
310 | 310 | query 1; heads |
|
311 | 311 | searching for changes |
|
312 | 312 | taking quick initial sample |
|
313 | 313 | searching: 2 queries |
|
314 | 314 | query 2; still undecided: 1240, sample size is: 100 |
|
315 | 315 | sampling from both directions |
|
316 | 316 | searching: 3 queries |
|
317 | 317 | query 3; still undecided: 1140, sample size is: 200 |
|
318 | 318 | sampling from both directions |
|
319 | 319 | searching: 4 queries |
|
320 | 320 | query 4; still undecided: \d+, sample size is: 200 (re) |
|
321 | 321 | sampling from both directions |
|
322 | 322 | searching: 5 queries |
|
323 | 323 | query 5; still undecided: \d+, sample size is: 200 (re) |
|
324 | 324 | sampling from both directions |
|
325 | 325 | searching: 6 queries |
|
326 | 326 | query 6; still undecided: \d+, sample size is: \d+ (re) |
|
327 | 327 | 6 total queries |
|
328 | 328 | common heads: 3ee37d65064a |
|
329 | 329 | |
|
330 | 330 | Test actual protocol when pulling one new head in addition to common heads |
|
331 | 331 | |
|
332 | 332 | $ hg clone -U b c |
|
333 | 333 | $ hg -R c id -ir tip |
|
334 | 334 | 513314ca8b3a |
|
335 | 335 | $ hg -R c up -qr default |
|
336 | 336 | $ touch c/f |
|
337 | 337 | $ hg -R c ci -Aqm "extra head" |
|
338 | 338 | $ hg -R c id -i |
|
339 | 339 | e64a39e7da8b |
|
340 | 340 | |
|
341 | 341 | $ hg serve -R c -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
342 | 342 | $ cat hg.pid >> $DAEMON_PIDS |
|
343 | 343 | |
|
344 | 344 | $ hg -R b incoming http://localhost:$HGPORT/ -T '{node|short}\n' |
|
345 | 345 | comparing with http://localhost:$HGPORT/ |
|
346 | 346 | searching for changes |
|
347 | 347 | e64a39e7da8b |
|
348 | 348 | |
|
349 | 349 | $ killdaemons.py |
|
350 | 350 | $ cut -d' ' -f6- access.log | grep -v cmd=known # cmd=known uses random sampling |
|
351 | 351 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
352 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D513314ca8b3ae4dac8eec56966265b00fcf866db | |
|
353 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=513314ca8b3ae4dac8eec56966265b00fcf866db&heads=e64a39e7da8b0d54bc63e81169aff001c13b3477 | |
|
354 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
|
352 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D513314ca8b3ae4dac8eec56966265b00fcf866db x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
353 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=513314ca8b3ae4dac8eec56966265b00fcf866db&heads=e64a39e7da8b0d54bc63e81169aff001c13b3477 x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
354 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
355 | 355 |
$ |
|
356 | 356 | |
|
357 | 357 | $ cd .. |
|
358 | 358 | |
|
359 | 359 | |
|
360 | 360 | Issue 4438 - test coverage for 3ef893520a85 issues. |
|
361 | 361 | |
|
362 | 362 | $ mkdir issue4438 |
|
363 | 363 | $ cd issue4438 |
|
364 | 364 | #if false |
|
365 | 365 | generate new bundles: |
|
366 | 366 | $ hg init r1 |
|
367 | 367 | $ for i in `python $TESTDIR/seq.py 101`; do hg -R r1 up -qr null && hg -R r1 branch -q b$i && hg -R r1 ci -qmb$i; done |
|
368 | 368 | $ hg clone -q r1 r2 |
|
369 | 369 | $ for i in `python $TESTDIR/seq.py 10`; do hg -R r1 up -qr null && hg -R r1 branch -q c$i && hg -R r1 ci -qmc$i; done |
|
370 | 370 | $ hg -R r2 branch -q r2change && hg -R r2 ci -qmr2change |
|
371 | 371 | $ hg -R r1 bundle -qa $TESTDIR/bundles/issue4438-r1.hg |
|
372 | 372 | $ hg -R r2 bundle -qa $TESTDIR/bundles/issue4438-r2.hg |
|
373 | 373 | #else |
|
374 | 374 | use existing bundles: |
|
375 | 375 | $ hg clone -q $TESTDIR/bundles/issue4438-r1.hg r1 |
|
376 | 376 | $ hg clone -q $TESTDIR/bundles/issue4438-r2.hg r2 |
|
377 | 377 | #endif |
|
378 | 378 | |
|
379 | 379 | Set iteration order could cause wrong and unstable results - fixed in 73cfaa348650: |
|
380 | 380 | |
|
381 | 381 | $ hg -R r1 outgoing r2 -T'{rev} ' |
|
382 | 382 | comparing with r2 |
|
383 | 383 | searching for changes |
|
384 | 384 | 101 102 103 104 105 106 107 108 109 110 (no-eol) |
|
385 | 385 | |
|
386 | 386 | The case where all the 'initialsamplesize' samples already were common would |
|
387 | 387 | give 'all remote heads known locally' without checking the remaining heads - |
|
388 | 388 | fixed in 86c35b7ae300: |
|
389 | 389 | |
|
390 | 390 | $ cat >> $TESTTMP/unrandomsample.py << EOF |
|
391 | 391 | > import random |
|
392 | 392 | > def sample(population, k): |
|
393 | 393 | > return sorted(population)[:k] |
|
394 | 394 | > random.sample = sample |
|
395 | 395 | > EOF |
|
396 | 396 | |
|
397 | 397 | $ cat >> r1/.hg/hgrc << EOF |
|
398 | 398 | > [extensions] |
|
399 | 399 | > unrandomsample = $TESTTMP/unrandomsample.py |
|
400 | 400 | > EOF |
|
401 | 401 | |
|
402 | 402 | $ hg -R r1 outgoing r2 -T'{rev} ' |
|
403 | 403 | comparing with r2 |
|
404 | 404 | searching for changes |
|
405 | 405 | 101 102 103 104 105 106 107 108 109 110 (no-eol) |
|
406 | 406 | $ cd .. |
@@ -1,536 +1,536 b'' | |||
|
1 | 1 | #require killdaemons |
|
2 | 2 | |
|
3 | 3 | Tests discovery against servers without getbundle support: |
|
4 | 4 | |
|
5 | 5 | $ CAP="getbundle bundle2" |
|
6 | 6 | $ . "$TESTDIR/notcapable" |
|
7 | 7 | $ cat >> $HGRCPATH <<EOF |
|
8 | 8 | > [ui] |
|
9 | 9 | > logtemplate="{rev} {node|short}: {desc} {branches}\n" |
|
10 | 10 | > EOF |
|
11 | 11 | |
|
12 | 12 | Setup HTTP server control: |
|
13 | 13 | |
|
14 | 14 | $ remote=http://localhost:$HGPORT/ |
|
15 | 15 | $ export remote |
|
16 | 16 | $ tstart() { |
|
17 | 17 | > echo '[web]' > $1/.hg/hgrc |
|
18 | 18 | > echo 'push_ssl = false' >> $1/.hg/hgrc |
|
19 | 19 | > echo 'allow_push = *' >> $1/.hg/hgrc |
|
20 | 20 | > hg serve -R $1 -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
21 | 21 | > cat hg.pid >> $DAEMON_PIDS |
|
22 | 22 | > } |
|
23 | 23 | $ tstop() { |
|
24 | 24 | > killdaemons.py |
|
25 | 25 | > [ "$1" ] && cut -d' ' -f6- access.log && cat errors.log |
|
26 | 26 | > rm access.log errors.log |
|
27 | 27 | > } |
|
28 | 28 | |
|
29 | 29 | Both are empty: |
|
30 | 30 | |
|
31 | 31 | $ hg init empty1 |
|
32 | 32 | $ hg init empty2 |
|
33 | 33 | $ tstart empty2 |
|
34 | 34 | $ hg incoming -R empty1 $remote |
|
35 | 35 | comparing with http://localhost:$HGPORT/ |
|
36 | 36 | no changes found |
|
37 | 37 | [1] |
|
38 | 38 | $ hg outgoing -R empty1 $remote |
|
39 | 39 | comparing with http://localhost:$HGPORT/ |
|
40 | 40 | no changes found |
|
41 | 41 | [1] |
|
42 | 42 | $ hg pull -R empty1 $remote |
|
43 | 43 | pulling from http://localhost:$HGPORT/ |
|
44 | 44 | no changes found |
|
45 | 45 | $ hg push -R empty1 $remote |
|
46 | 46 | pushing to http://localhost:$HGPORT/ |
|
47 | 47 | no changes found |
|
48 | 48 | [1] |
|
49 | 49 | $ tstop |
|
50 | 50 | |
|
51 | 51 | Base repo: |
|
52 | 52 | |
|
53 | 53 | $ hg init main |
|
54 | 54 | $ cd main |
|
55 | 55 | $ hg debugbuilddag -mo '+2:tbase @name1 +3:thead1 <tbase @name2 +4:thead2 @both /thead1 +2:tmaintip' |
|
56 | 56 | $ hg log -G |
|
57 | 57 | o 11 a19bfa7e7328: r11 both |
|
58 | 58 | | |
|
59 | 59 | o 10 8b6bad1512e1: r10 both |
|
60 | 60 | | |
|
61 | 61 | o 9 025829e08038: r9 both |
|
62 | 62 | |\ |
|
63 | 63 | | o 8 d8f638ac69e9: r8 name2 |
|
64 | 64 | | | |
|
65 | 65 | | o 7 b6b4d315a2ac: r7 name2 |
|
66 | 66 | | | |
|
67 | 67 | | o 6 6c6f5d5f3c11: r6 name2 |
|
68 | 68 | | | |
|
69 | 69 | | o 5 70314b29987d: r5 name2 |
|
70 | 70 | | | |
|
71 | 71 | o | 4 e71dbbc70e03: r4 name1 |
|
72 | 72 | | | |
|
73 | 73 | o | 3 2c8d5d5ec612: r3 name1 |
|
74 | 74 | | | |
|
75 | 75 | o | 2 a7892891da29: r2 name1 |
|
76 | 76 | |/ |
|
77 | 77 | o 1 0019a3b924fd: r1 |
|
78 | 78 | | |
|
79 | 79 | o 0 d57206cc072a: r0 |
|
80 | 80 | |
|
81 | 81 | $ cd .. |
|
82 | 82 | $ tstart main |
|
83 | 83 | |
|
84 | 84 | Full clone: |
|
85 | 85 | |
|
86 | 86 | $ hg clone main full |
|
87 | 87 | updating to branch default |
|
88 | 88 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
89 | 89 | $ cd full |
|
90 | 90 | $ hg incoming $remote |
|
91 | 91 | comparing with http://localhost:$HGPORT/ |
|
92 | 92 | searching for changes |
|
93 | 93 | no changes found |
|
94 | 94 | [1] |
|
95 | 95 | $ hg outgoing $remote |
|
96 | 96 | comparing with http://localhost:$HGPORT/ |
|
97 | 97 | searching for changes |
|
98 | 98 | no changes found |
|
99 | 99 | [1] |
|
100 | 100 | $ hg pull $remote |
|
101 | 101 | pulling from http://localhost:$HGPORT/ |
|
102 | 102 | searching for changes |
|
103 | 103 | no changes found |
|
104 | 104 | $ hg push $remote |
|
105 | 105 | pushing to http://localhost:$HGPORT/ |
|
106 | 106 | searching for changes |
|
107 | 107 | no changes found |
|
108 | 108 | [1] |
|
109 | 109 | $ cd .. |
|
110 | 110 | |
|
111 | 111 | Local is empty: |
|
112 | 112 | |
|
113 | 113 | $ cd empty1 |
|
114 | 114 | $ hg incoming $remote |
|
115 | 115 | comparing with http://localhost:$HGPORT/ |
|
116 | 116 | 0 d57206cc072a: r0 |
|
117 | 117 | 1 0019a3b924fd: r1 |
|
118 | 118 | 2 a7892891da29: r2 name1 |
|
119 | 119 | 3 2c8d5d5ec612: r3 name1 |
|
120 | 120 | 4 e71dbbc70e03: r4 name1 |
|
121 | 121 | 5 70314b29987d: r5 name2 |
|
122 | 122 | 6 6c6f5d5f3c11: r6 name2 |
|
123 | 123 | 7 b6b4d315a2ac: r7 name2 |
|
124 | 124 | 8 d8f638ac69e9: r8 name2 |
|
125 | 125 | 9 025829e08038: r9 both |
|
126 | 126 | 10 8b6bad1512e1: r10 both |
|
127 | 127 | 11 a19bfa7e7328: r11 both |
|
128 | 128 | $ hg outgoing $remote |
|
129 | 129 | comparing with http://localhost:$HGPORT/ |
|
130 | 130 | no changes found |
|
131 | 131 | [1] |
|
132 | 132 | $ hg push $remote |
|
133 | 133 | pushing to http://localhost:$HGPORT/ |
|
134 | 134 | no changes found |
|
135 | 135 | [1] |
|
136 | 136 | $ hg pull $remote |
|
137 | 137 | pulling from http://localhost:$HGPORT/ |
|
138 | 138 | requesting all changes |
|
139 | 139 | adding changesets |
|
140 | 140 | adding manifests |
|
141 | 141 | adding file changes |
|
142 | 142 | added 12 changesets with 24 changes to 2 files |
|
143 | 143 | (run 'hg update' to get a working copy) |
|
144 | 144 | $ hg incoming $remote |
|
145 | 145 | comparing with http://localhost:$HGPORT/ |
|
146 | 146 | searching for changes |
|
147 | 147 | no changes found |
|
148 | 148 | [1] |
|
149 | 149 | $ cd .. |
|
150 | 150 | |
|
151 | 151 | Local is subset: |
|
152 | 152 | |
|
153 | 153 | $ hg clone main subset --rev name2 ; cd subset |
|
154 | 154 | adding changesets |
|
155 | 155 | adding manifests |
|
156 | 156 | adding file changes |
|
157 | 157 | added 6 changesets with 12 changes to 2 files |
|
158 | 158 | updating to branch name2 |
|
159 | 159 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
160 | 160 | $ hg incoming $remote |
|
161 | 161 | comparing with http://localhost:$HGPORT/ |
|
162 | 162 | searching for changes |
|
163 | 163 | 6 a7892891da29: r2 name1 |
|
164 | 164 | 7 2c8d5d5ec612: r3 name1 |
|
165 | 165 | 8 e71dbbc70e03: r4 name1 |
|
166 | 166 | 9 025829e08038: r9 both |
|
167 | 167 | 10 8b6bad1512e1: r10 both |
|
168 | 168 | 11 a19bfa7e7328: r11 both |
|
169 | 169 | $ hg outgoing $remote |
|
170 | 170 | comparing with http://localhost:$HGPORT/ |
|
171 | 171 | searching for changes |
|
172 | 172 | no changes found |
|
173 | 173 | [1] |
|
174 | 174 | $ hg push $remote |
|
175 | 175 | pushing to http://localhost:$HGPORT/ |
|
176 | 176 | searching for changes |
|
177 | 177 | no changes found |
|
178 | 178 | [1] |
|
179 | 179 | $ hg pull $remote |
|
180 | 180 | pulling from http://localhost:$HGPORT/ |
|
181 | 181 | searching for changes |
|
182 | 182 | adding changesets |
|
183 | 183 | adding manifests |
|
184 | 184 | adding file changes |
|
185 | 185 | added 6 changesets with 12 changes to 2 files |
|
186 | 186 | (run 'hg update' to get a working copy) |
|
187 | 187 | $ hg incoming $remote |
|
188 | 188 | comparing with http://localhost:$HGPORT/ |
|
189 | 189 | searching for changes |
|
190 | 190 | no changes found |
|
191 | 191 | [1] |
|
192 | 192 | $ cd .. |
|
193 | 193 | $ tstop |
|
194 | 194 | |
|
195 | 195 | Remote is empty: |
|
196 | 196 | |
|
197 | 197 | $ tstart empty2 |
|
198 | 198 | $ cd main |
|
199 | 199 | $ hg incoming $remote |
|
200 | 200 | comparing with http://localhost:$HGPORT/ |
|
201 | 201 | searching for changes |
|
202 | 202 | no changes found |
|
203 | 203 | [1] |
|
204 | 204 | $ hg outgoing $remote |
|
205 | 205 | comparing with http://localhost:$HGPORT/ |
|
206 | 206 | searching for changes |
|
207 | 207 | 0 d57206cc072a: r0 |
|
208 | 208 | 1 0019a3b924fd: r1 |
|
209 | 209 | 2 a7892891da29: r2 name1 |
|
210 | 210 | 3 2c8d5d5ec612: r3 name1 |
|
211 | 211 | 4 e71dbbc70e03: r4 name1 |
|
212 | 212 | 5 70314b29987d: r5 name2 |
|
213 | 213 | 6 6c6f5d5f3c11: r6 name2 |
|
214 | 214 | 7 b6b4d315a2ac: r7 name2 |
|
215 | 215 | 8 d8f638ac69e9: r8 name2 |
|
216 | 216 | 9 025829e08038: r9 both |
|
217 | 217 | 10 8b6bad1512e1: r10 both |
|
218 | 218 | 11 a19bfa7e7328: r11 both |
|
219 | 219 | $ hg pull $remote |
|
220 | 220 | pulling from http://localhost:$HGPORT/ |
|
221 | 221 | searching for changes |
|
222 | 222 | no changes found |
|
223 | 223 | $ hg push $remote |
|
224 | 224 | pushing to http://localhost:$HGPORT/ |
|
225 | 225 | searching for changes |
|
226 | 226 | remote: adding changesets |
|
227 | 227 | remote: adding manifests |
|
228 | 228 | remote: adding file changes |
|
229 | 229 | remote: added 12 changesets with 24 changes to 2 files |
|
230 | 230 | $ hg outgoing $remote |
|
231 | 231 | comparing with http://localhost:$HGPORT/ |
|
232 | 232 | searching for changes |
|
233 | 233 | no changes found |
|
234 | 234 | [1] |
|
235 | 235 | $ cd .. |
|
236 | 236 | $ tstop |
|
237 | 237 | |
|
238 | 238 | Local is superset: |
|
239 | 239 | |
|
240 | 240 | $ hg clone main subset2 --rev name2 |
|
241 | 241 | adding changesets |
|
242 | 242 | adding manifests |
|
243 | 243 | adding file changes |
|
244 | 244 | added 6 changesets with 12 changes to 2 files |
|
245 | 245 | updating to branch name2 |
|
246 | 246 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
247 | 247 | $ tstart subset2 |
|
248 | 248 | $ cd main |
|
249 | 249 | $ hg incoming $remote |
|
250 | 250 | comparing with http://localhost:$HGPORT/ |
|
251 | 251 | searching for changes |
|
252 | 252 | no changes found |
|
253 | 253 | [1] |
|
254 | 254 | $ hg outgoing $remote |
|
255 | 255 | comparing with http://localhost:$HGPORT/ |
|
256 | 256 | searching for changes |
|
257 | 257 | 2 a7892891da29: r2 name1 |
|
258 | 258 | 3 2c8d5d5ec612: r3 name1 |
|
259 | 259 | 4 e71dbbc70e03: r4 name1 |
|
260 | 260 | 9 025829e08038: r9 both |
|
261 | 261 | 10 8b6bad1512e1: r10 both |
|
262 | 262 | 11 a19bfa7e7328: r11 both |
|
263 | 263 | $ hg pull $remote |
|
264 | 264 | pulling from http://localhost:$HGPORT/ |
|
265 | 265 | searching for changes |
|
266 | 266 | no changes found |
|
267 | 267 | $ hg push $remote |
|
268 | 268 | pushing to http://localhost:$HGPORT/ |
|
269 | 269 | searching for changes |
|
270 | 270 | abort: push creates new remote branches: both, name1! |
|
271 | 271 | (use 'hg push --new-branch' to create new remote branches) |
|
272 | 272 | [255] |
|
273 | 273 | $ hg push $remote --new-branch |
|
274 | 274 | pushing to http://localhost:$HGPORT/ |
|
275 | 275 | searching for changes |
|
276 | 276 | remote: adding changesets |
|
277 | 277 | remote: adding manifests |
|
278 | 278 | remote: adding file changes |
|
279 | 279 | remote: added 6 changesets with 12 changes to 2 files |
|
280 | 280 | $ hg outgoing $remote |
|
281 | 281 | comparing with http://localhost:$HGPORT/ |
|
282 | 282 | searching for changes |
|
283 | 283 | no changes found |
|
284 | 284 | [1] |
|
285 | 285 | $ cd .. |
|
286 | 286 | $ tstop |
|
287 | 287 | |
|
288 | 288 | Partial pull: |
|
289 | 289 | |
|
290 | 290 | $ tstart main |
|
291 | 291 | $ hg clone $remote partial --rev name2 |
|
292 | 292 | adding changesets |
|
293 | 293 | adding manifests |
|
294 | 294 | adding file changes |
|
295 | 295 | added 6 changesets with 12 changes to 2 files |
|
296 | 296 | updating to branch name2 |
|
297 | 297 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
298 | 298 | $ cd partial |
|
299 | 299 | $ hg incoming $remote |
|
300 | 300 | comparing with http://localhost:$HGPORT/ |
|
301 | 301 | searching for changes |
|
302 | 302 | 6 a7892891da29: r2 name1 |
|
303 | 303 | 7 2c8d5d5ec612: r3 name1 |
|
304 | 304 | 8 e71dbbc70e03: r4 name1 |
|
305 | 305 | 9 025829e08038: r9 both |
|
306 | 306 | 10 8b6bad1512e1: r10 both |
|
307 | 307 | 11 a19bfa7e7328: r11 both |
|
308 | 308 | $ hg incoming $remote --rev name1 |
|
309 | 309 | comparing with http://localhost:$HGPORT/ |
|
310 | 310 | searching for changes |
|
311 | 311 | 6 a7892891da29: r2 name1 |
|
312 | 312 | 7 2c8d5d5ec612: r3 name1 |
|
313 | 313 | 8 e71dbbc70e03: r4 name1 |
|
314 | 314 | $ hg pull $remote --rev name1 |
|
315 | 315 | pulling from http://localhost:$HGPORT/ |
|
316 | 316 | searching for changes |
|
317 | 317 | adding changesets |
|
318 | 318 | adding manifests |
|
319 | 319 | adding file changes |
|
320 | 320 | added 3 changesets with 6 changes to 2 files (+1 heads) |
|
321 | 321 | (run 'hg heads' to see heads) |
|
322 | 322 | $ hg incoming $remote |
|
323 | 323 | comparing with http://localhost:$HGPORT/ |
|
324 | 324 | searching for changes |
|
325 | 325 | 9 025829e08038: r9 both |
|
326 | 326 | 10 8b6bad1512e1: r10 both |
|
327 | 327 | 11 a19bfa7e7328: r11 both |
|
328 | 328 | $ cd .. |
|
329 | 329 | $ tstop |
|
330 | 330 | |
|
331 | 331 | Both have new stuff in new named branches: |
|
332 | 332 | |
|
333 | 333 | $ hg clone main repo1a --rev name1 -q |
|
334 | 334 | $ hg clone repo1a repo1b -q |
|
335 | 335 | $ hg clone main repo2a --rev name2 -q |
|
336 | 336 | $ hg clone repo2a repo2b -q |
|
337 | 337 | $ tstart repo1a |
|
338 | 338 | |
|
339 | 339 | $ cd repo2a |
|
340 | 340 | $ hg incoming $remote |
|
341 | 341 | comparing with http://localhost:$HGPORT/ |
|
342 | 342 | searching for changes |
|
343 | 343 | 6 a7892891da29: r2 name1 |
|
344 | 344 | 7 2c8d5d5ec612: r3 name1 |
|
345 | 345 | 8 e71dbbc70e03: r4 name1 |
|
346 | 346 | $ hg outgoing $remote |
|
347 | 347 | comparing with http://localhost:$HGPORT/ |
|
348 | 348 | searching for changes |
|
349 | 349 | 2 70314b29987d: r5 name2 |
|
350 | 350 | 3 6c6f5d5f3c11: r6 name2 |
|
351 | 351 | 4 b6b4d315a2ac: r7 name2 |
|
352 | 352 | 5 d8f638ac69e9: r8 name2 |
|
353 | 353 | $ hg push $remote --new-branch |
|
354 | 354 | pushing to http://localhost:$HGPORT/ |
|
355 | 355 | searching for changes |
|
356 | 356 | remote: adding changesets |
|
357 | 357 | remote: adding manifests |
|
358 | 358 | remote: adding file changes |
|
359 | 359 | remote: added 4 changesets with 8 changes to 2 files (+1 heads) |
|
360 | 360 | $ hg pull $remote |
|
361 | 361 | pulling from http://localhost:$HGPORT/ |
|
362 | 362 | searching for changes |
|
363 | 363 | adding changesets |
|
364 | 364 | adding manifests |
|
365 | 365 | adding file changes |
|
366 | 366 | added 3 changesets with 6 changes to 2 files (+1 heads) |
|
367 | 367 | (run 'hg heads' to see heads) |
|
368 | 368 | $ hg incoming $remote |
|
369 | 369 | comparing with http://localhost:$HGPORT/ |
|
370 | 370 | searching for changes |
|
371 | 371 | no changes found |
|
372 | 372 | [1] |
|
373 | 373 | $ hg outgoing $remote |
|
374 | 374 | comparing with http://localhost:$HGPORT/ |
|
375 | 375 | searching for changes |
|
376 | 376 | no changes found |
|
377 | 377 | [1] |
|
378 | 378 | $ cd .. |
|
379 | 379 | $ tstop |
|
380 | 380 | |
|
381 | 381 | $ tstart repo1b |
|
382 | 382 | $ cd repo2b |
|
383 | 383 | $ hg incoming $remote |
|
384 | 384 | comparing with http://localhost:$HGPORT/ |
|
385 | 385 | searching for changes |
|
386 | 386 | 6 a7892891da29: r2 name1 |
|
387 | 387 | 7 2c8d5d5ec612: r3 name1 |
|
388 | 388 | 8 e71dbbc70e03: r4 name1 |
|
389 | 389 | $ hg outgoing $remote |
|
390 | 390 | comparing with http://localhost:$HGPORT/ |
|
391 | 391 | searching for changes |
|
392 | 392 | 2 70314b29987d: r5 name2 |
|
393 | 393 | 3 6c6f5d5f3c11: r6 name2 |
|
394 | 394 | 4 b6b4d315a2ac: r7 name2 |
|
395 | 395 | 5 d8f638ac69e9: r8 name2 |
|
396 | 396 | $ hg pull $remote |
|
397 | 397 | pulling from http://localhost:$HGPORT/ |
|
398 | 398 | searching for changes |
|
399 | 399 | adding changesets |
|
400 | 400 | adding manifests |
|
401 | 401 | adding file changes |
|
402 | 402 | added 3 changesets with 6 changes to 2 files (+1 heads) |
|
403 | 403 | (run 'hg heads' to see heads) |
|
404 | 404 | $ hg push $remote --new-branch |
|
405 | 405 | pushing to http://localhost:$HGPORT/ |
|
406 | 406 | searching for changes |
|
407 | 407 | remote: adding changesets |
|
408 | 408 | remote: adding manifests |
|
409 | 409 | remote: adding file changes |
|
410 | 410 | remote: added 4 changesets with 8 changes to 2 files (+1 heads) |
|
411 | 411 | $ hg incoming $remote |
|
412 | 412 | comparing with http://localhost:$HGPORT/ |
|
413 | 413 | searching for changes |
|
414 | 414 | no changes found |
|
415 | 415 | [1] |
|
416 | 416 | $ hg outgoing $remote |
|
417 | 417 | comparing with http://localhost:$HGPORT/ |
|
418 | 418 | searching for changes |
|
419 | 419 | no changes found |
|
420 | 420 | [1] |
|
421 | 421 | $ cd .. |
|
422 | 422 | $ tstop |
|
423 | 423 | |
|
424 | 424 | Both have new stuff in existing named branches: |
|
425 | 425 | |
|
426 | 426 | $ rm -r repo1a repo1b repo2a repo2b |
|
427 | 427 | $ hg clone main repo1a --rev 3 --rev 8 -q |
|
428 | 428 | $ hg clone repo1a repo1b -q |
|
429 | 429 | $ hg clone main repo2a --rev 4 --rev 7 -q |
|
430 | 430 | $ hg clone repo2a repo2b -q |
|
431 | 431 | $ tstart repo1a |
|
432 | 432 | |
|
433 | 433 | $ cd repo2a |
|
434 | 434 | $ hg incoming $remote |
|
435 | 435 | comparing with http://localhost:$HGPORT/ |
|
436 | 436 | searching for changes |
|
437 | 437 | 8 d8f638ac69e9: r8 name2 |
|
438 | 438 | $ hg outgoing $remote |
|
439 | 439 | comparing with http://localhost:$HGPORT/ |
|
440 | 440 | searching for changes |
|
441 | 441 | 4 e71dbbc70e03: r4 name1 |
|
442 | 442 | $ hg push $remote --new-branch |
|
443 | 443 | pushing to http://localhost:$HGPORT/ |
|
444 | 444 | searching for changes |
|
445 | 445 | remote: adding changesets |
|
446 | 446 | remote: adding manifests |
|
447 | 447 | remote: adding file changes |
|
448 | 448 | remote: added 1 changesets with 2 changes to 2 files |
|
449 | 449 | $ hg pull $remote |
|
450 | 450 | pulling from http://localhost:$HGPORT/ |
|
451 | 451 | searching for changes |
|
452 | 452 | adding changesets |
|
453 | 453 | adding manifests |
|
454 | 454 | adding file changes |
|
455 | 455 | added 1 changesets with 2 changes to 2 files |
|
456 | 456 | (run 'hg update' to get a working copy) |
|
457 | 457 | $ hg incoming $remote |
|
458 | 458 | comparing with http://localhost:$HGPORT/ |
|
459 | 459 | searching for changes |
|
460 | 460 | no changes found |
|
461 | 461 | [1] |
|
462 | 462 | $ hg outgoing $remote |
|
463 | 463 | comparing with http://localhost:$HGPORT/ |
|
464 | 464 | searching for changes |
|
465 | 465 | no changes found |
|
466 | 466 | [1] |
|
467 | 467 | $ cd .. |
|
468 | 468 | $ tstop |
|
469 | 469 | |
|
470 | 470 | $ tstart repo1b |
|
471 | 471 | $ cd repo2b |
|
472 | 472 | $ hg incoming $remote |
|
473 | 473 | comparing with http://localhost:$HGPORT/ |
|
474 | 474 | searching for changes |
|
475 | 475 | 8 d8f638ac69e9: r8 name2 |
|
476 | 476 | $ hg outgoing $remote |
|
477 | 477 | comparing with http://localhost:$HGPORT/ |
|
478 | 478 | searching for changes |
|
479 | 479 | 4 e71dbbc70e03: r4 name1 |
|
480 | 480 | $ hg pull $remote |
|
481 | 481 | pulling from http://localhost:$HGPORT/ |
|
482 | 482 | searching for changes |
|
483 | 483 | adding changesets |
|
484 | 484 | adding manifests |
|
485 | 485 | adding file changes |
|
486 | 486 | added 1 changesets with 2 changes to 2 files |
|
487 | 487 | (run 'hg update' to get a working copy) |
|
488 | 488 | $ hg push $remote --new-branch |
|
489 | 489 | pushing to http://localhost:$HGPORT/ |
|
490 | 490 | searching for changes |
|
491 | 491 | remote: adding changesets |
|
492 | 492 | remote: adding manifests |
|
493 | 493 | remote: adding file changes |
|
494 | 494 | remote: added 1 changesets with 2 changes to 2 files |
|
495 | 495 | $ hg incoming $remote |
|
496 | 496 | comparing with http://localhost:$HGPORT/ |
|
497 | 497 | searching for changes |
|
498 | 498 | no changes found |
|
499 | 499 | [1] |
|
500 | 500 | $ hg outgoing $remote |
|
501 | 501 | comparing with http://localhost:$HGPORT/ |
|
502 | 502 | searching for changes |
|
503 | 503 | no changes found |
|
504 | 504 | [1] |
|
505 | 505 | $ cd .. |
|
506 | 506 | $ tstop show |
|
507 | 507 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
508 | "GET /?cmd=heads HTTP/1.1" 200 - | |
|
509 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 | |
|
510 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 | |
|
511 | "GET /?cmd=changegroupsubset HTTP/1.1" 200 - x-hgarg-1:bases=d8f638ac69e9ae8dea4f09f11d696546a912d961&heads=d8f638ac69e9ae8dea4f09f11d696546a912d961 | |
|
512 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
|
508 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
509 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
510 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
511 | "GET /?cmd=changegroupsubset HTTP/1.1" 200 - x-hgarg-1:bases=d8f638ac69e9ae8dea4f09f11d696546a912d961&heads=d8f638ac69e9ae8dea4f09f11d696546a912d961 x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
512 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
513 | 513 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
514 | "GET /?cmd=heads HTTP/1.1" 200 - | |
|
515 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 | |
|
516 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 | |
|
514 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
515 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
516 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
517 | 517 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
518 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
519 | "GET /?cmd=heads HTTP/1.1" 200 - | |
|
520 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 | |
|
521 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 | |
|
522 | "GET /?cmd=changegroupsubset HTTP/1.1" 200 - x-hgarg-1:bases=d8f638ac69e9ae8dea4f09f11d696546a912d961&heads=d8f638ac69e9ae8dea4f09f11d696546a912d961 | |
|
523 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
|
518 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
519 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
520 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
521 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
522 | "GET /?cmd=changegroupsubset HTTP/1.1" 200 - x-hgarg-1:bases=d8f638ac69e9ae8dea4f09f11d696546a912d961&heads=d8f638ac69e9ae8dea4f09f11d696546a912d961 x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
523 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
524 | 524 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
525 | "GET /?cmd=heads HTTP/1.1" 200 - | |
|
526 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
|
527 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
528 | "GET /?cmd=branchmap HTTP/1.1" 200 - | |
|
529 | "GET /?cmd=branchmap HTTP/1.1" 200 - | |
|
530 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
525 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
526 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
527 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
528 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
529 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
530 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
531 | 531 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+1827a5bb63e602382eb89dd58f2ac9f3b007ad91* (glob) |
|
532 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
|
532 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
533 | 533 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
534 | "GET /?cmd=heads HTTP/1.1" 200 - | |
|
534 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 | |
|
535 | 535 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
536 | "GET /?cmd=heads HTTP/1.1" 200 - | |
|
536 | "GET /?cmd=heads HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 |
@@ -1,162 +1,162 b'' | |||
|
1 | 1 | #require killdaemons |
|
2 | 2 | |
|
3 | 3 | Test wire protocol argument passing |
|
4 | 4 | |
|
5 | 5 | Setup repo: |
|
6 | 6 | |
|
7 | 7 | $ hg init repo |
|
8 | 8 | |
|
9 | 9 | Local: |
|
10 | 10 | |
|
11 | 11 | $ hg debugwireargs repo eins zwei --three drei --four vier |
|
12 | 12 | eins zwei drei vier None |
|
13 | 13 | $ hg debugwireargs repo eins zwei --four vier |
|
14 | 14 | eins zwei None vier None |
|
15 | 15 | $ hg debugwireargs repo eins zwei |
|
16 | 16 | eins zwei None None None |
|
17 | 17 | $ hg debugwireargs repo eins zwei --five fuenf |
|
18 | 18 | eins zwei None None fuenf |
|
19 | 19 | |
|
20 | 20 | HTTP: |
|
21 | 21 | |
|
22 | 22 | $ hg serve -R repo -p $HGPORT -d --pid-file=hg1.pid \ |
|
23 | 23 | > -E error.log -A access.log \ |
|
24 | 24 | > --config experimental.httppostargs=yes |
|
25 | 25 | $ cat hg1.pid >> $DAEMON_PIDS |
|
26 | 26 | |
|
27 | 27 | $ hg debugwireargs http://localhost:$HGPORT/ un deux trois quatre |
|
28 | 28 | un deux trois quatre None |
|
29 | 29 | $ hg debugwireargs http://localhost:$HGPORT/ \ un deux trois\ qu\ \ atre |
|
30 | 30 | un deux trois qu atre None |
|
31 | 31 | $ hg debugwireargs http://localhost:$HGPORT/ eins zwei --four vier |
|
32 | 32 | eins zwei None vier None |
|
33 | 33 | $ hg debugwireargs http://localhost:$HGPORT/ eins zwei |
|
34 | 34 | eins zwei None None None |
|
35 | 35 | $ hg debugwireargs http://localhost:$HGPORT/ eins zwei --five fuenf |
|
36 | 36 | eins zwei None None None |
|
37 | 37 | $ hg debugwireargs http://localhost:$HGPORT/ un deux trois onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
|
38 | 38 | un deux trois onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx None |
|
39 | 39 | $ cat error.log |
|
40 | 40 | $ cat access.log |
|
41 | 41 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
42 | 42 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:39* (glob) |
|
43 | 43 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:39* (glob) |
|
44 | 44 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
45 | 45 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:43* (glob) |
|
46 | 46 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:43* (glob) |
|
47 | 47 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
48 | 48 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:27* (glob) |
|
49 | 49 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:27* (glob) |
|
50 | 50 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
51 | 51 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob) |
|
52 | 52 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob) |
|
53 | 53 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
54 | 54 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob) |
|
55 | 55 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob) |
|
56 | 56 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
57 | 57 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:1033* (glob) |
|
58 | 58 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:1033* (glob) |
|
59 | 59 | |
|
60 | 60 | HTTP without args-in-POST: |
|
61 | 61 | $ hg serve -R repo -p $HGPORT1 -d --pid-file=hg1.pid -E error.log -A access.log |
|
62 | 62 | $ cat hg1.pid >> $DAEMON_PIDS |
|
63 | 63 | |
|
64 | 64 | $ hg debugwireargs http://localhost:$HGPORT1/ un deux trois quatre |
|
65 | 65 | un deux trois quatre None |
|
66 | 66 | $ hg debugwireargs http://localhost:$HGPORT1/ \ un deux trois\ qu\ \ atre |
|
67 | 67 | un deux trois qu atre None |
|
68 | 68 | $ hg debugwireargs http://localhost:$HGPORT1/ eins zwei --four vier |
|
69 | 69 | eins zwei None vier None |
|
70 | 70 | $ hg debugwireargs http://localhost:$HGPORT1/ eins zwei |
|
71 | 71 | eins zwei None None None |
|
72 | 72 | $ hg debugwireargs http://localhost:$HGPORT1/ eins zwei --five fuenf |
|
73 | 73 | eins zwei None None None |
|
74 | 74 | $ hg debugwireargs http://localhost:$HGPORT1/ un deux trois onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
|
75 | 75 | un deux trois onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx None |
|
76 | 76 | $ cat error.log |
|
77 | 77 | $ cat access.log |
|
78 | 78 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
79 | 79 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:39* (glob) |
|
80 | 80 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:39* (glob) |
|
81 | 81 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
82 | 82 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:43* (glob) |
|
83 | 83 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:43* (glob) |
|
84 | 84 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
85 | 85 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:27* (glob) |
|
86 | 86 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:27* (glob) |
|
87 | 87 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
88 | 88 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob) |
|
89 | 89 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob) |
|
90 | 90 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
91 | 91 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob) |
|
92 | 92 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:17* (glob) |
|
93 | 93 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
94 | 94 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:1033* (glob) |
|
95 | 95 | * - - [*] "POST /?cmd=debugwireargs HTTP/1.1" 200 - x-hgargs-post:1033* (glob) |
|
96 | 96 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
97 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=quatre&one=un&three=trois&two=deux (glob) | |
|
98 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=quatre&one=un&three=trois&two=deux (glob) | |
|
97 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=quatre&one=un&three=trois&two=deux x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
98 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=quatre&one=un&three=trois&two=deux x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
99 | 99 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
100 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=qu++atre&one=+un&three=trois+&two=deux (glob) | |
|
101 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=qu++atre&one=+un&three=trois+&two=deux (glob) | |
|
100 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=qu++atre&one=+un&three=trois+&two=deux x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
101 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=qu++atre&one=+un&three=trois+&two=deux x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
102 | 102 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
103 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=vier&one=eins&two=zwei (glob) | |
|
104 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=vier&one=eins&two=zwei (glob) | |
|
103 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=vier&one=eins&two=zwei x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
104 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=vier&one=eins&two=zwei x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
105 | 105 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
106 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei (glob) | |
|
107 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei (glob) | |
|
106 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
107 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
108 | 108 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
109 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei (glob) | |
|
110 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei (glob) | |
|
109 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
110 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
111 | 111 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
112 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&one x-hgarg-2:=un&three=trois&two=deux (glob) | |
|
113 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&one x-hgarg-2:=un&three=trois&two=deux (glob) | |
|
112 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&one x-hgarg-2:=un&three=trois&two=deux x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
113 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&one x-hgarg-2:=un&three=trois&two=deux x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
114 | 114 | |
|
115 | 115 | HTTP without the httpheader capability: |
|
116 | 116 | |
|
117 | 117 | $ HGRCPATH="`pwd`/repo/.hgrc" |
|
118 | 118 | $ export HGRCPATH |
|
119 | 119 | $ CAP=httpheader |
|
120 | 120 | $ . "$TESTDIR/notcapable" |
|
121 | 121 | |
|
122 | 122 | $ hg serve -R repo -p $HGPORT2 -d --pid-file=hg2.pid -E error2.log -A access2.log |
|
123 | 123 | $ cat hg2.pid >> $DAEMON_PIDS |
|
124 | 124 | |
|
125 | 125 | $ hg debugwireargs http://localhost:$HGPORT2/ un deux trois quatre |
|
126 | 126 | un deux trois quatre None |
|
127 | 127 | $ hg debugwireargs http://localhost:$HGPORT2/ eins zwei --four vier |
|
128 | 128 | eins zwei None vier None |
|
129 | 129 | $ hg debugwireargs http://localhost:$HGPORT2/ eins zwei |
|
130 | 130 | eins zwei None None None |
|
131 | 131 | $ hg debugwireargs http://localhost:$HGPORT2/ eins zwei --five fuenf |
|
132 | 132 | eins zwei None None None |
|
133 | 133 | $ cat error2.log |
|
134 | 134 | $ cat access2.log |
|
135 | 135 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
136 | * - - [*] "GET /?cmd=debugwireargs&four=quatre&one=un&three=trois&two=deux HTTP/1.1" 200 - (glob) | |
|
137 | * - - [*] "GET /?cmd=debugwireargs&four=quatre&one=un&three=trois&two=deux HTTP/1.1" 200 - (glob) | |
|
136 | * - - [*] "GET /?cmd=debugwireargs&four=quatre&one=un&three=trois&two=deux HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
137 | * - - [*] "GET /?cmd=debugwireargs&four=quatre&one=un&three=trois&two=deux HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
138 | 138 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
139 | * - - [*] "GET /?cmd=debugwireargs&four=vier&one=eins&two=zwei HTTP/1.1" 200 - (glob) | |
|
140 | * - - [*] "GET /?cmd=debugwireargs&four=vier&one=eins&two=zwei HTTP/1.1" 200 - (glob) | |
|
139 | * - - [*] "GET /?cmd=debugwireargs&four=vier&one=eins&two=zwei HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
140 | * - - [*] "GET /?cmd=debugwireargs&four=vier&one=eins&two=zwei HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
141 | 141 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
142 | * - - [*] "GET /?cmd=debugwireargs&one=eins&two=zwei HTTP/1.1" 200 - (glob) | |
|
143 | * - - [*] "GET /?cmd=debugwireargs&one=eins&two=zwei HTTP/1.1" 200 - (glob) | |
|
142 | * - - [*] "GET /?cmd=debugwireargs&one=eins&two=zwei HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
143 | * - - [*] "GET /?cmd=debugwireargs&one=eins&two=zwei HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
144 | 144 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
145 | * - - [*] "GET /?cmd=debugwireargs&one=eins&two=zwei HTTP/1.1" 200 - (glob) | |
|
146 | * - - [*] "GET /?cmd=debugwireargs&one=eins&two=zwei HTTP/1.1" 200 - (glob) | |
|
145 | * - - [*] "GET /?cmd=debugwireargs&one=eins&two=zwei HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
146 | * - - [*] "GET /?cmd=debugwireargs&one=eins&two=zwei HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
|
147 | 147 | |
|
148 | 148 | SSH (try to exercise the ssh functionality with a dummy script): |
|
149 | 149 | |
|
150 | 150 | $ hg debugwireargs --ssh "python $TESTDIR/dummyssh" ssh://user@dummy/repo uno due tre quattro |
|
151 | 151 | uno due tre quattro None |
|
152 | 152 | $ hg debugwireargs --ssh "python $TESTDIR/dummyssh" ssh://user@dummy/repo eins zwei --four vier |
|
153 | 153 | eins zwei None vier None |
|
154 | 154 | $ hg debugwireargs --ssh "python $TESTDIR/dummyssh" ssh://user@dummy/repo eins zwei |
|
155 | 155 | eins zwei None None None |
|
156 | 156 | $ hg debugwireargs --ssh "python $TESTDIR/dummyssh" ssh://user@dummy/repo eins zwei --five fuenf |
|
157 | 157 | eins zwei None None None |
|
158 | 158 | |
|
159 | 159 | Explicitly kill daemons to let the test exit on Windows |
|
160 | 160 | |
|
161 | 161 | $ killdaemons.py |
|
162 | 162 |
General Comments 0
You need to be logged in to leave comments.
Login now