##// END OF EJS Templates
exchangev2: use filesdata...
Gregory Szorc -
r40215:b843356d default
parent child Browse files
Show More
@@ -1,420 +1,503 b''
1 # exchangev2.py - repository exchange for wire protocol version 2
1 # exchangev2.py - repository exchange for wire protocol version 2
2 #
2 #
3 # Copyright 2018 Gregory Szorc <gregory.szorc@gmail.com>
3 # Copyright 2018 Gregory Szorc <gregory.szorc@gmail.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import collections
10 import collections
11 import weakref
11 import weakref
12
12
13 from .i18n import _
13 from .i18n import _
14 from .node import (
14 from .node import (
15 nullid,
15 nullid,
16 short,
16 short,
17 )
17 )
18 from . import (
18 from . import (
19 bookmarks,
19 bookmarks,
20 error,
20 error,
21 mdiff,
21 mdiff,
22 phases,
22 phases,
23 pycompat,
23 pycompat,
24 setdiscovery,
24 setdiscovery,
25 )
25 )
26
26
27 def pull(pullop):
27 def pull(pullop):
28 """Pull using wire protocol version 2."""
28 """Pull using wire protocol version 2."""
29 repo = pullop.repo
29 repo = pullop.repo
30 remote = pullop.remote
30 remote = pullop.remote
31 tr = pullop.trmanager.transaction()
31 tr = pullop.trmanager.transaction()
32
32
33 # Figure out what needs to be fetched.
33 # Figure out what needs to be fetched.
34 common, fetch, remoteheads = _pullchangesetdiscovery(
34 common, fetch, remoteheads = _pullchangesetdiscovery(
35 repo, remote, pullop.heads, abortwhenunrelated=pullop.force)
35 repo, remote, pullop.heads, abortwhenunrelated=pullop.force)
36
36
37 # And fetch the data.
37 # And fetch the data.
38 pullheads = pullop.heads or remoteheads
38 pullheads = pullop.heads or remoteheads
39 csetres = _fetchchangesets(repo, tr, remote, common, fetch, pullheads)
39 csetres = _fetchchangesets(repo, tr, remote, common, fetch, pullheads)
40
40
41 # New revisions are written to the changelog. But all other updates
41 # New revisions are written to the changelog. But all other updates
42 # are deferred. Do those now.
42 # are deferred. Do those now.
43
43
44 # Ensure all new changesets are draft by default. If the repo is
44 # Ensure all new changesets are draft by default. If the repo is
45 # publishing, the phase will be adjusted by the loop below.
45 # publishing, the phase will be adjusted by the loop below.
46 if csetres['added']:
46 if csetres['added']:
47 phases.registernew(repo, tr, phases.draft, csetres['added'])
47 phases.registernew(repo, tr, phases.draft, csetres['added'])
48
48
49 # And adjust the phase of all changesets accordingly.
49 # And adjust the phase of all changesets accordingly.
50 for phase in phases.phasenames:
50 for phase in phases.phasenames:
51 if phase == b'secret' or not csetres['nodesbyphase'][phase]:
51 if phase == b'secret' or not csetres['nodesbyphase'][phase]:
52 continue
52 continue
53
53
54 phases.advanceboundary(repo, tr, phases.phasenames.index(phase),
54 phases.advanceboundary(repo, tr, phases.phasenames.index(phase),
55 csetres['nodesbyphase'][phase])
55 csetres['nodesbyphase'][phase])
56
56
57 # Write bookmark updates.
57 # Write bookmark updates.
58 bookmarks.updatefromremote(repo.ui, repo, csetres['bookmarks'],
58 bookmarks.updatefromremote(repo.ui, repo, csetres['bookmarks'],
59 remote.url(), pullop.gettransaction,
59 remote.url(), pullop.gettransaction,
60 explicit=pullop.explicitbookmarks)
60 explicit=pullop.explicitbookmarks)
61
61
62 manres = _fetchmanifests(repo, tr, remote, csetres['manifestnodes'])
62 manres = _fetchmanifests(repo, tr, remote, csetres['manifestnodes'])
63
63
64 # Find all file nodes referenced by added manifests and fetch those
64 # Find all file nodes referenced by added manifests and fetch those
65 # revisions.
65 # revisions.
66 fnodes = _derivefilesfrommanifests(repo, manres['added'])
66 fnodes = _derivefilesfrommanifests(repo, manres['added'])
67 _fetchfiles(repo, tr, remote, fnodes, manres['linkrevs'])
67 _fetchfilesfromcsets(repo, tr, remote, fnodes, csetres['added'],
68 manres['linkrevs'])
68
69
69 def _pullchangesetdiscovery(repo, remote, heads, abortwhenunrelated=True):
70 def _pullchangesetdiscovery(repo, remote, heads, abortwhenunrelated=True):
70 """Determine which changesets need to be pulled."""
71 """Determine which changesets need to be pulled."""
71
72
72 if heads:
73 if heads:
73 knownnode = repo.changelog.hasnode
74 knownnode = repo.changelog.hasnode
74 if all(knownnode(head) for head in heads):
75 if all(knownnode(head) for head in heads):
75 return heads, False, heads
76 return heads, False, heads
76
77
77 # TODO wire protocol version 2 is capable of more efficient discovery
78 # TODO wire protocol version 2 is capable of more efficient discovery
78 # than setdiscovery. Consider implementing something better.
79 # than setdiscovery. Consider implementing something better.
79 common, fetch, remoteheads = setdiscovery.findcommonheads(
80 common, fetch, remoteheads = setdiscovery.findcommonheads(
80 repo.ui, repo, remote, abortwhenunrelated=abortwhenunrelated)
81 repo.ui, repo, remote, abortwhenunrelated=abortwhenunrelated)
81
82
82 common = set(common)
83 common = set(common)
83 remoteheads = set(remoteheads)
84 remoteheads = set(remoteheads)
84
85
85 # If a remote head is filtered locally, put it back in the common set.
86 # If a remote head is filtered locally, put it back in the common set.
86 # See the comment in exchange._pulldiscoverychangegroup() for more.
87 # See the comment in exchange._pulldiscoverychangegroup() for more.
87
88
88 if fetch and remoteheads:
89 if fetch and remoteheads:
89 nodemap = repo.unfiltered().changelog.nodemap
90 nodemap = repo.unfiltered().changelog.nodemap
90
91
91 common |= {head for head in remoteheads if head in nodemap}
92 common |= {head for head in remoteheads if head in nodemap}
92
93
93 if set(remoteheads).issubset(common):
94 if set(remoteheads).issubset(common):
94 fetch = []
95 fetch = []
95
96
96 common.discard(nullid)
97 common.discard(nullid)
97
98
98 return common, fetch, remoteheads
99 return common, fetch, remoteheads
99
100
100 def _fetchchangesets(repo, tr, remote, common, fetch, remoteheads):
101 def _fetchchangesets(repo, tr, remote, common, fetch, remoteheads):
101 # TODO consider adding a step here where we obtain the DAG shape first
102 # TODO consider adding a step here where we obtain the DAG shape first
102 # (or ask the server to slice changesets into chunks for us) so that
103 # (or ask the server to slice changesets into chunks for us) so that
103 # we can perform multiple fetches in batches. This will facilitate
104 # we can perform multiple fetches in batches. This will facilitate
104 # resuming interrupted clones, higher server-side cache hit rates due
105 # resuming interrupted clones, higher server-side cache hit rates due
105 # to smaller segments, etc.
106 # to smaller segments, etc.
106 with remote.commandexecutor() as e:
107 with remote.commandexecutor() as e:
107 objs = e.callcommand(b'changesetdata', {
108 objs = e.callcommand(b'changesetdata', {
108 b'revisions': [{
109 b'revisions': [{
109 b'type': b'changesetdagrange',
110 b'type': b'changesetdagrange',
110 b'roots': sorted(common),
111 b'roots': sorted(common),
111 b'heads': sorted(remoteheads),
112 b'heads': sorted(remoteheads),
112 }],
113 }],
113 b'fields': {b'bookmarks', b'parents', b'phase', b'revision'},
114 b'fields': {b'bookmarks', b'parents', b'phase', b'revision'},
114 }).result()
115 }).result()
115
116
116 # The context manager waits on all response data when exiting. So
117 # The context manager waits on all response data when exiting. So
117 # we need to remain in the context manager in order to stream data.
118 # we need to remain in the context manager in order to stream data.
118 return _processchangesetdata(repo, tr, objs)
119 return _processchangesetdata(repo, tr, objs)
119
120
120 def _processchangesetdata(repo, tr, objs):
121 def _processchangesetdata(repo, tr, objs):
121 repo.hook('prechangegroup', throw=True,
122 repo.hook('prechangegroup', throw=True,
122 **pycompat.strkwargs(tr.hookargs))
123 **pycompat.strkwargs(tr.hookargs))
123
124
124 urepo = repo.unfiltered()
125 urepo = repo.unfiltered()
125 cl = urepo.changelog
126 cl = urepo.changelog
126
127
127 cl.delayupdate(tr)
128 cl.delayupdate(tr)
128
129
129 # The first emitted object is a header describing the data that
130 # The first emitted object is a header describing the data that
130 # follows.
131 # follows.
131 meta = next(objs)
132 meta = next(objs)
132
133
133 progress = repo.ui.makeprogress(_('changesets'),
134 progress = repo.ui.makeprogress(_('changesets'),
134 unit=_('chunks'),
135 unit=_('chunks'),
135 total=meta.get(b'totalitems'))
136 total=meta.get(b'totalitems'))
136
137
137 manifestnodes = {}
138 manifestnodes = {}
138
139
139 def linkrev(node):
140 def linkrev(node):
140 repo.ui.debug('add changeset %s\n' % short(node))
141 repo.ui.debug('add changeset %s\n' % short(node))
141 # Linkrev for changelog is always self.
142 # Linkrev for changelog is always self.
142 return len(cl)
143 return len(cl)
143
144
144 def onchangeset(cl, node):
145 def onchangeset(cl, node):
145 progress.increment()
146 progress.increment()
146
147
147 revision = cl.changelogrevision(node)
148 revision = cl.changelogrevision(node)
148
149
149 # We need to preserve the mapping of changelog revision to node
150 # We need to preserve the mapping of changelog revision to node
150 # so we can set the linkrev accordingly when manifests are added.
151 # so we can set the linkrev accordingly when manifests are added.
151 manifestnodes[cl.rev(node)] = revision.manifest
152 manifestnodes[cl.rev(node)] = revision.manifest
152
153
153 nodesbyphase = {phase: set() for phase in phases.phasenames}
154 nodesbyphase = {phase: set() for phase in phases.phasenames}
154 remotebookmarks = {}
155 remotebookmarks = {}
155
156
156 # addgroup() expects a 7-tuple describing revisions. This normalizes
157 # addgroup() expects a 7-tuple describing revisions. This normalizes
157 # the wire data to that format.
158 # the wire data to that format.
158 #
159 #
159 # This loop also aggregates non-revision metadata, such as phase
160 # This loop also aggregates non-revision metadata, such as phase
160 # data.
161 # data.
161 def iterrevisions():
162 def iterrevisions():
162 for cset in objs:
163 for cset in objs:
163 node = cset[b'node']
164 node = cset[b'node']
164
165
165 if b'phase' in cset:
166 if b'phase' in cset:
166 nodesbyphase[cset[b'phase']].add(node)
167 nodesbyphase[cset[b'phase']].add(node)
167
168
168 for mark in cset.get(b'bookmarks', []):
169 for mark in cset.get(b'bookmarks', []):
169 remotebookmarks[mark] = node
170 remotebookmarks[mark] = node
170
171
171 # TODO add mechanism for extensions to examine records so they
172 # TODO add mechanism for extensions to examine records so they
172 # can siphon off custom data fields.
173 # can siphon off custom data fields.
173
174
174 extrafields = {}
175 extrafields = {}
175
176
176 for field, size in cset.get(b'fieldsfollowing', []):
177 for field, size in cset.get(b'fieldsfollowing', []):
177 extrafields[field] = next(objs)
178 extrafields[field] = next(objs)
178
179
179 # Some entries might only be metadata only updates.
180 # Some entries might only be metadata only updates.
180 if b'revision' not in extrafields:
181 if b'revision' not in extrafields:
181 continue
182 continue
182
183
183 data = extrafields[b'revision']
184 data = extrafields[b'revision']
184
185
185 yield (
186 yield (
186 node,
187 node,
187 cset[b'parents'][0],
188 cset[b'parents'][0],
188 cset[b'parents'][1],
189 cset[b'parents'][1],
189 # Linknode is always itself for changesets.
190 # Linknode is always itself for changesets.
190 cset[b'node'],
191 cset[b'node'],
191 # We always send full revisions. So delta base is not set.
192 # We always send full revisions. So delta base is not set.
192 nullid,
193 nullid,
193 mdiff.trivialdiffheader(len(data)) + data,
194 mdiff.trivialdiffheader(len(data)) + data,
194 # Flags not yet supported.
195 # Flags not yet supported.
195 0,
196 0,
196 )
197 )
197
198
198 added = cl.addgroup(iterrevisions(), linkrev, weakref.proxy(tr),
199 added = cl.addgroup(iterrevisions(), linkrev, weakref.proxy(tr),
199 addrevisioncb=onchangeset)
200 addrevisioncb=onchangeset)
200
201
201 progress.complete()
202 progress.complete()
202
203
203 return {
204 return {
204 'added': added,
205 'added': added,
205 'nodesbyphase': nodesbyphase,
206 'nodesbyphase': nodesbyphase,
206 'bookmarks': remotebookmarks,
207 'bookmarks': remotebookmarks,
207 'manifestnodes': manifestnodes,
208 'manifestnodes': manifestnodes,
208 }
209 }
209
210
210 def _fetchmanifests(repo, tr, remote, manifestnodes):
211 def _fetchmanifests(repo, tr, remote, manifestnodes):
211 rootmanifest = repo.manifestlog.getstorage(b'')
212 rootmanifest = repo.manifestlog.getstorage(b'')
212
213
213 # Some manifests can be shared between changesets. Filter out revisions
214 # Some manifests can be shared between changesets. Filter out revisions
214 # we already know about.
215 # we already know about.
215 fetchnodes = []
216 fetchnodes = []
216 linkrevs = {}
217 linkrevs = {}
217 seen = set()
218 seen = set()
218
219
219 for clrev, node in sorted(manifestnodes.iteritems()):
220 for clrev, node in sorted(manifestnodes.iteritems()):
220 if node in seen:
221 if node in seen:
221 continue
222 continue
222
223
223 try:
224 try:
224 rootmanifest.rev(node)
225 rootmanifest.rev(node)
225 except error.LookupError:
226 except error.LookupError:
226 fetchnodes.append(node)
227 fetchnodes.append(node)
227 linkrevs[node] = clrev
228 linkrevs[node] = clrev
228
229
229 seen.add(node)
230 seen.add(node)
230
231
231 # TODO handle tree manifests
232 # TODO handle tree manifests
232
233
233 # addgroup() expects 7-tuple describing revisions. This normalizes
234 # addgroup() expects 7-tuple describing revisions. This normalizes
234 # the wire data to that format.
235 # the wire data to that format.
235 def iterrevisions(objs, progress):
236 def iterrevisions(objs, progress):
236 for manifest in objs:
237 for manifest in objs:
237 node = manifest[b'node']
238 node = manifest[b'node']
238
239
239 extrafields = {}
240 extrafields = {}
240
241
241 for field, size in manifest.get(b'fieldsfollowing', []):
242 for field, size in manifest.get(b'fieldsfollowing', []):
242 extrafields[field] = next(objs)
243 extrafields[field] = next(objs)
243
244
244 if b'delta' in extrafields:
245 if b'delta' in extrafields:
245 basenode = manifest[b'deltabasenode']
246 basenode = manifest[b'deltabasenode']
246 delta = extrafields[b'delta']
247 delta = extrafields[b'delta']
247 elif b'revision' in extrafields:
248 elif b'revision' in extrafields:
248 basenode = nullid
249 basenode = nullid
249 revision = extrafields[b'revision']
250 revision = extrafields[b'revision']
250 delta = mdiff.trivialdiffheader(len(revision)) + revision
251 delta = mdiff.trivialdiffheader(len(revision)) + revision
251 else:
252 else:
252 continue
253 continue
253
254
254 yield (
255 yield (
255 node,
256 node,
256 manifest[b'parents'][0],
257 manifest[b'parents'][0],
257 manifest[b'parents'][1],
258 manifest[b'parents'][1],
258 # The value passed in is passed to the lookup function passed
259 # The value passed in is passed to the lookup function passed
259 # to addgroup(). We already have a map of manifest node to
260 # to addgroup(). We already have a map of manifest node to
260 # changelog revision number. So we just pass in the
261 # changelog revision number. So we just pass in the
261 # manifest node here and use linkrevs.__getitem__ as the
262 # manifest node here and use linkrevs.__getitem__ as the
262 # resolution function.
263 # resolution function.
263 node,
264 node,
264 basenode,
265 basenode,
265 delta,
266 delta,
266 # Flags not yet supported.
267 # Flags not yet supported.
267 0
268 0
268 )
269 )
269
270
270 progress.increment()
271 progress.increment()
271
272
272 progress = repo.ui.makeprogress(_('manifests'), unit=_('chunks'),
273 progress = repo.ui.makeprogress(_('manifests'), unit=_('chunks'),
273 total=len(fetchnodes))
274 total=len(fetchnodes))
274
275
275 commandmeta = remote.apidescriptor[b'commands'][b'manifestdata']
276 commandmeta = remote.apidescriptor[b'commands'][b'manifestdata']
276 batchsize = commandmeta.get(b'recommendedbatchsize', 10000)
277 batchsize = commandmeta.get(b'recommendedbatchsize', 10000)
277 # TODO make size configurable on client?
278 # TODO make size configurable on client?
278
279
279 # We send commands 1 at a time to the remote. This is not the most
280 # We send commands 1 at a time to the remote. This is not the most
280 # efficient because we incur a round trip at the end of each batch.
281 # efficient because we incur a round trip at the end of each batch.
281 # However, the existing frame-based reactor keeps consuming server
282 # However, the existing frame-based reactor keeps consuming server
282 # data in the background. And this results in response data buffering
283 # data in the background. And this results in response data buffering
283 # in memory. This can consume gigabytes of memory.
284 # in memory. This can consume gigabytes of memory.
284 # TODO send multiple commands in a request once background buffering
285 # TODO send multiple commands in a request once background buffering
285 # issues are resolved.
286 # issues are resolved.
286
287
287 added = []
288 added = []
288
289
289 for i in pycompat.xrange(0, len(fetchnodes), batchsize):
290 for i in pycompat.xrange(0, len(fetchnodes), batchsize):
290 batch = [node for node in fetchnodes[i:i + batchsize]]
291 batch = [node for node in fetchnodes[i:i + batchsize]]
291 if not batch:
292 if not batch:
292 continue
293 continue
293
294
294 with remote.commandexecutor() as e:
295 with remote.commandexecutor() as e:
295 objs = e.callcommand(b'manifestdata', {
296 objs = e.callcommand(b'manifestdata', {
296 b'tree': b'',
297 b'tree': b'',
297 b'nodes': batch,
298 b'nodes': batch,
298 b'fields': {b'parents', b'revision'},
299 b'fields': {b'parents', b'revision'},
299 b'haveparents': True,
300 b'haveparents': True,
300 }).result()
301 }).result()
301
302
302 # Chomp off header object.
303 # Chomp off header object.
303 next(objs)
304 next(objs)
304
305
305 added.extend(rootmanifest.addgroup(
306 added.extend(rootmanifest.addgroup(
306 iterrevisions(objs, progress),
307 iterrevisions(objs, progress),
307 linkrevs.__getitem__,
308 linkrevs.__getitem__,
308 weakref.proxy(tr)))
309 weakref.proxy(tr)))
309
310
310 progress.complete()
311 progress.complete()
311
312
312 return {
313 return {
313 'added': added,
314 'added': added,
314 'linkrevs': linkrevs,
315 'linkrevs': linkrevs,
315 }
316 }
316
317
317 def _derivefilesfrommanifests(repo, manifestnodes):
318 def _derivefilesfrommanifests(repo, manifestnodes):
318 """Determine what file nodes are relevant given a set of manifest nodes.
319 """Determine what file nodes are relevant given a set of manifest nodes.
319
320
320 Returns a dict mapping file paths to dicts of file node to first manifest
321 Returns a dict mapping file paths to dicts of file node to first manifest
321 node.
322 node.
322 """
323 """
323 ml = repo.manifestlog
324 ml = repo.manifestlog
324 fnodes = collections.defaultdict(dict)
325 fnodes = collections.defaultdict(dict)
325
326
326 progress = repo.ui.makeprogress(
327 progress = repo.ui.makeprogress(
327 _('scanning manifests'), total=len(manifestnodes))
328 _('scanning manifests'), total=len(manifestnodes))
328
329
329 with progress:
330 with progress:
330 for manifestnode in manifestnodes:
331 for manifestnode in manifestnodes:
331 m = ml.get(b'', manifestnode)
332 m = ml.get(b'', manifestnode)
332
333
333 # TODO this will pull in unwanted nodes because it takes the storage
334 # TODO this will pull in unwanted nodes because it takes the storage
334 # delta into consideration. What we really want is something that
335 # delta into consideration. What we really want is something that
335 # takes the delta between the manifest's parents. And ideally we
336 # takes the delta between the manifest's parents. And ideally we
336 # would ignore file nodes that are known locally. For now, ignore
337 # would ignore file nodes that are known locally. For now, ignore
337 # both these limitations. This will result in incremental fetches
338 # both these limitations. This will result in incremental fetches
338 # requesting data we already have. So this is far from ideal.
339 # requesting data we already have. So this is far from ideal.
339 md = m.readfast()
340 md = m.readfast()
340
341
341 for path, fnode in md.items():
342 for path, fnode in md.items():
342 fnodes[path].setdefault(fnode, manifestnode)
343 fnodes[path].setdefault(fnode, manifestnode)
343
344
344 progress.increment()
345 progress.increment()
345
346
346 return fnodes
347 return fnodes
347
348
348 def _fetchfiles(repo, tr, remote, fnodes, linkrevs):
349 def _fetchfiles(repo, tr, remote, fnodes, linkrevs):
350 """Fetch file data from explicit file revisions."""
349 def iterrevisions(objs, progress):
351 def iterrevisions(objs, progress):
350 for filerevision in objs:
352 for filerevision in objs:
351 node = filerevision[b'node']
353 node = filerevision[b'node']
352
354
353 extrafields = {}
355 extrafields = {}
354
356
355 for field, size in filerevision.get(b'fieldsfollowing', []):
357 for field, size in filerevision.get(b'fieldsfollowing', []):
356 extrafields[field] = next(objs)
358 extrafields[field] = next(objs)
357
359
358 if b'delta' in extrafields:
360 if b'delta' in extrafields:
359 basenode = filerevision[b'deltabasenode']
361 basenode = filerevision[b'deltabasenode']
360 delta = extrafields[b'delta']
362 delta = extrafields[b'delta']
361 elif b'revision' in extrafields:
363 elif b'revision' in extrafields:
362 basenode = nullid
364 basenode = nullid
363 revision = extrafields[b'revision']
365 revision = extrafields[b'revision']
364 delta = mdiff.trivialdiffheader(len(revision)) + revision
366 delta = mdiff.trivialdiffheader(len(revision)) + revision
365 else:
367 else:
366 continue
368 continue
367
369
368 yield (
370 yield (
369 node,
371 node,
370 filerevision[b'parents'][0],
372 filerevision[b'parents'][0],
371 filerevision[b'parents'][1],
373 filerevision[b'parents'][1],
372 node,
374 node,
373 basenode,
375 basenode,
374 delta,
376 delta,
375 # Flags not yet supported.
377 # Flags not yet supported.
376 0,
378 0,
377 )
379 )
378
380
379 progress.increment()
381 progress.increment()
380
382
381 progress = repo.ui.makeprogress(
383 progress = repo.ui.makeprogress(
382 _('files'), unit=_('chunks'),
384 _('files'), unit=_('chunks'),
383 total=sum(len(v) for v in fnodes.itervalues()))
385 total=sum(len(v) for v in fnodes.itervalues()))
384
386
385 # TODO make batch size configurable
387 # TODO make batch size configurable
386 batchsize = 10000
388 batchsize = 10000
387 fnodeslist = [x for x in sorted(fnodes.items())]
389 fnodeslist = [x for x in sorted(fnodes.items())]
388
390
389 for i in pycompat.xrange(0, len(fnodeslist), batchsize):
391 for i in pycompat.xrange(0, len(fnodeslist), batchsize):
390 batch = [x for x in fnodeslist[i:i + batchsize]]
392 batch = [x for x in fnodeslist[i:i + batchsize]]
391 if not batch:
393 if not batch:
392 continue
394 continue
393
395
394 with remote.commandexecutor() as e:
396 with remote.commandexecutor() as e:
395 fs = []
397 fs = []
396 locallinkrevs = {}
398 locallinkrevs = {}
397
399
398 for path, nodes in batch:
400 for path, nodes in batch:
399 fs.append((path, e.callcommand(b'filedata', {
401 fs.append((path, e.callcommand(b'filedata', {
400 b'path': path,
402 b'path': path,
401 b'nodes': sorted(nodes),
403 b'nodes': sorted(nodes),
402 b'fields': {b'parents', b'revision'},
404 b'fields': {b'parents', b'revision'},
403 b'haveparents': True,
405 b'haveparents': True,
404 })))
406 })))
405
407
406 locallinkrevs[path] = {
408 locallinkrevs[path] = {
407 node: linkrevs[manifestnode]
409 node: linkrevs[manifestnode]
408 for node, manifestnode in nodes.iteritems()}
410 for node, manifestnode in nodes.iteritems()}
409
411
410 for path, f in fs:
412 for path, f in fs:
411 objs = f.result()
413 objs = f.result()
412
414
413 # Chomp off header objects.
415 # Chomp off header objects.
414 next(objs)
416 next(objs)
415
417
416 store = repo.file(path)
418 store = repo.file(path)
417 store.addgroup(
419 store.addgroup(
418 iterrevisions(objs, progress),
420 iterrevisions(objs, progress),
419 locallinkrevs[path].__getitem__,
421 locallinkrevs[path].__getitem__,
420 weakref.proxy(tr))
422 weakref.proxy(tr))
423
424 def _fetchfilesfromcsets(repo, tr, remote, fnodes, csets, manlinkrevs):
425 """Fetch file data from explicit changeset revisions."""
426
427 def iterrevisions(objs, remaining, progress):
428 while remaining:
429 filerevision = next(objs)
430
431 node = filerevision[b'node']
432
433 extrafields = {}
434
435 for field, size in filerevision.get(b'fieldsfollowing', []):
436 extrafields[field] = next(objs)
437
438 if b'delta' in extrafields:
439 basenode = filerevision[b'deltabasenode']
440 delta = extrafields[b'delta']
441 elif b'revision' in extrafields:
442 basenode = nullid
443 revision = extrafields[b'revision']
444 delta = mdiff.trivialdiffheader(len(revision)) + revision
445 else:
446 continue
447
448 yield (
449 node,
450 filerevision[b'parents'][0],
451 filerevision[b'parents'][1],
452 node,
453 basenode,
454 delta,
455 # Flags not yet supported.
456 0,
457 )
458
459 progress.increment()
460 remaining -= 1
461
462 progress = repo.ui.makeprogress(
463 _('files'), unit=_('chunks'),
464 total=sum(len(v) for v in fnodes.itervalues()))
465
466 commandmeta = remote.apidescriptor[b'commands'][b'filesdata']
467 batchsize = commandmeta.get(b'recommendedbatchsize', 50000)
468
469 for i in pycompat.xrange(0, len(csets), batchsize):
470 batch = [x for x in csets[i:i + batchsize]]
471 if not batch:
472 continue
473
474 with remote.commandexecutor() as e:
475 args = {
476 b'revisions': [{
477 b'type': b'changesetexplicit',
478 b'nodes': batch,
479 }],
480 b'fields': {b'parents', b'revision'},
481 b'haveparents': True,
482 }
483
484 objs = e.callcommand(b'filesdata', args).result()
485
486 # First object is an overall header.
487 overall = next(objs)
488
489 # We have overall['totalpaths'] segments.
490 for i in pycompat.xrange(overall[b'totalpaths']):
491 header = next(objs)
492
493 path = header[b'path']
494 store = repo.file(path)
495
496 linkrevs = {
497 fnode: manlinkrevs[mnode]
498 for fnode, mnode in fnodes[path].iteritems()}
499
500 store.addgroup(iterrevisions(objs, header[b'totalitems'],
501 progress),
502 linkrevs.__getitem__,
503 weakref.proxy(tr))
@@ -1,662 +1,621 b''
1 Tests for wire protocol version 2 exchange.
1 Tests for wire protocol version 2 exchange.
2 Tests in this file should be folded into existing tests once protocol
2 Tests in this file should be folded into existing tests once protocol
3 v2 has enough features that it can be enabled via #testcase in existing
3 v2 has enough features that it can be enabled via #testcase in existing
4 tests.
4 tests.
5
5
6 $ . $TESTDIR/wireprotohelpers.sh
6 $ . $TESTDIR/wireprotohelpers.sh
7 $ enablehttpv2client
7 $ enablehttpv2client
8
8
9 $ hg init server-simple
9 $ hg init server-simple
10 $ enablehttpv2 server-simple
10 $ enablehttpv2 server-simple
11 $ cd server-simple
11 $ cd server-simple
12 $ cat >> .hg/hgrc << EOF
12 $ cat >> .hg/hgrc << EOF
13 > [phases]
13 > [phases]
14 > publish = false
14 > publish = false
15 > EOF
15 > EOF
16 $ echo a0 > a
16 $ echo a0 > a
17 $ echo b0 > b
17 $ echo b0 > b
18 $ hg -q commit -A -m 'commit 0'
18 $ hg -q commit -A -m 'commit 0'
19
19
20 $ echo a1 > a
20 $ echo a1 > a
21 $ hg commit -m 'commit 1'
21 $ hg commit -m 'commit 1'
22 $ hg phase --public -r .
22 $ hg phase --public -r .
23 $ echo a2 > a
23 $ echo a2 > a
24 $ hg commit -m 'commit 2'
24 $ hg commit -m 'commit 2'
25
25
26 $ hg -q up -r 0
26 $ hg -q up -r 0
27 $ echo b1 > b
27 $ echo b1 > b
28 $ hg -q commit -m 'head 2 commit 1'
28 $ hg -q commit -m 'head 2 commit 1'
29 $ echo b2 > b
29 $ echo b2 > b
30 $ hg -q commit -m 'head 2 commit 2'
30 $ hg -q commit -m 'head 2 commit 2'
31
31
32 $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log
32 $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log
33 $ cat hg.pid > $DAEMON_PIDS
33 $ cat hg.pid > $DAEMON_PIDS
34
34
35 $ cd ..
35 $ cd ..
36
36
37 Test basic clone
37 Test basic clone
38
38
39 $ hg --debug clone -U http://localhost:$HGPORT client-simple
39 $ hg --debug clone -U http://localhost:$HGPORT client-simple
40 using http://localhost:$HGPORT/
40 using http://localhost:$HGPORT/
41 sending capabilities command
41 sending capabilities command
42 query 1; heads
42 query 1; heads
43 sending 2 commands
43 sending 2 commands
44 sending command heads: {}
44 sending command heads: {}
45 sending command known: {
45 sending command known: {
46 'nodes': []
46 'nodes': []
47 }
47 }
48 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
48 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
49 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
49 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
50 received frame(size=43; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
50 received frame(size=43; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
51 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
51 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
52 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
52 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
53 received frame(size=1; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
53 received frame(size=1; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
54 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
54 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
55 sending 1 commands
55 sending 1 commands
56 sending command changesetdata: {
56 sending command changesetdata: {
57 'fields': set([
57 'fields': set([
58 'bookmarks',
58 'bookmarks',
59 'parents',
59 'parents',
60 'phase',
60 'phase',
61 'revision'
61 'revision'
62 ]),
62 ]),
63 'revisions': [
63 'revisions': [
64 {
64 {
65 'heads': [
65 'heads': [
66 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
66 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
67 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
67 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
68 ],
68 ],
69 'roots': [],
69 'roots': [],
70 'type': 'changesetdagrange'
70 'type': 'changesetdagrange'
71 }
71 }
72 ]
72 ]
73 }
73 }
74 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
74 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
75 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
75 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
76 received frame(size=941; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
76 received frame(size=941; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
77 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
77 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
78 add changeset 3390ef850073
78 add changeset 3390ef850073
79 add changeset 4432d83626e8
79 add changeset 4432d83626e8
80 add changeset cd2534766bec
80 add changeset cd2534766bec
81 add changeset e96ae20f4188
81 add changeset e96ae20f4188
82 add changeset caa2a465451d
82 add changeset caa2a465451d
83 checking for updated bookmarks
83 checking for updated bookmarks
84 sending 1 commands
84 sending 1 commands
85 sending command manifestdata: {
85 sending command manifestdata: {
86 'fields': set([
86 'fields': set([
87 'parents',
87 'parents',
88 'revision'
88 'revision'
89 ]),
89 ]),
90 'haveparents': True,
90 'haveparents': True,
91 'nodes': [
91 'nodes': [
92 '\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A',
92 '\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A',
93 '\xa9\x88\xfbCX>\x87\x1d\x1e\xd5u\x0e\xe0t\xc6\xd8@\xbb\xbf\xc8',
93 '\xa9\x88\xfbCX>\x87\x1d\x1e\xd5u\x0e\xe0t\xc6\xd8@\xbb\xbf\xc8',
94 '\xec\x80NH\x8c \x88\xc25\t\x9a\x10 u\x13\xbe\xcd\xc3\xdd\xa5',
94 '\xec\x80NH\x8c \x88\xc25\t\x9a\x10 u\x13\xbe\xcd\xc3\xdd\xa5',
95 '\x04\\\x7f9\'\xda\x13\xe7Z\xf8\xf0\xe4\xf0HI\xe4a\xa9x\x0f',
95 '\x04\\\x7f9\'\xda\x13\xe7Z\xf8\xf0\xe4\xf0HI\xe4a\xa9x\x0f',
96 '7\x9c\xb0\xc2\xe6d\\y\xdd\xc5\x9a\x1dG\'\xa9\xfb\x83\n\xeb&'
96 '7\x9c\xb0\xc2\xe6d\\y\xdd\xc5\x9a\x1dG\'\xa9\xfb\x83\n\xeb&'
97 ],
97 ],
98 'tree': ''
98 'tree': ''
99 }
99 }
100 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
100 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
101 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
101 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
102 received frame(size=992; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
102 received frame(size=992; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
103 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
103 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
104 sending 2 commands
104 sending 1 commands
105 sending command filedata: {
105 sending command filesdata: {
106 'fields': set([
106 'fields': set([
107 'parents',
107 'parents',
108 'revision'
108 'revision'
109 ]),
109 ]),
110 'haveparents': True,
110 'haveparents': True,
111 'nodes': [
111 'revisions': [
112 '+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda',
112 {
113 '\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc',
113 'nodes': [
114 '\xc2\xa2\x05\xc8\xb2\xad\xe2J\xf2`b\xe5<\xd5\xbc8\x01\xd6`\xda'
114 '3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:',
115 ],
115 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0',
116 'path': 'a'
116 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f',
117 }
117 '\xe9j\xe2\x0fA\x88H{\x9a\xe4\xef9A\xc2|\x81\x141F\xe5',
118 sending command filedata: {
118 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1'
119 'fields': set([
119 ],
120 'parents',
120 'type': 'changesetexplicit'
121 'revision'
121 }
122 ]),
122 ]
123 'haveparents': True,
124 'nodes': [
125 '\x81\x9e%\x8d1\xa5\xe1`f)\xf3e\xbb\x90*\x1b!\xeeB\x16',
126 '\xb1zk\xd3g=\x9a\xb8\xce\xd5\x81\xa2\t\xf6/=\xa5\xccEx',
127 '\xc5\xb1\xf9\xd3n\x1c\xc18\xbf\xb6\xef\xb3\xde\xb7]\x8c\xcad\x94\xc3'
128 ],
129 'path': 'b'
130 }
123 }
131 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
124 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
132 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
125 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
133 received frame(size=431; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
126 received frame(size=901; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
134 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
127 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
135 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
136 received frame(size=431; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
137 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
138 updating the branch cache
128 updating the branch cache
139 new changesets 3390ef850073:caa2a465451d (3 drafts)
129 new changesets 3390ef850073:caa2a465451d (3 drafts)
140 (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
130 (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
141
131
142 All changesets should have been transferred
132 All changesets should have been transferred
143
133
144 $ hg -R client-simple debugindex -c
134 $ hg -R client-simple debugindex -c
145 rev linkrev nodeid p1 p2
135 rev linkrev nodeid p1 p2
146 0 0 3390ef850073 000000000000 000000000000
136 0 0 3390ef850073 000000000000 000000000000
147 1 1 4432d83626e8 3390ef850073 000000000000
137 1 1 4432d83626e8 3390ef850073 000000000000
148 2 2 cd2534766bec 4432d83626e8 000000000000
138 2 2 cd2534766bec 4432d83626e8 000000000000
149 3 3 e96ae20f4188 3390ef850073 000000000000
139 3 3 e96ae20f4188 3390ef850073 000000000000
150 4 4 caa2a465451d e96ae20f4188 000000000000
140 4 4 caa2a465451d e96ae20f4188 000000000000
151
141
152 $ hg -R client-simple log -G -T '{rev} {node} {phase}\n'
142 $ hg -R client-simple log -G -T '{rev} {node} {phase}\n'
153 o 4 caa2a465451dd1facda0f5b12312c355584188a1 draft
143 o 4 caa2a465451dd1facda0f5b12312c355584188a1 draft
154 |
144 |
155 o 3 e96ae20f4188487b9ae4ef3941c27c81143146e5 draft
145 o 3 e96ae20f4188487b9ae4ef3941c27c81143146e5 draft
156 |
146 |
157 | o 2 cd2534766bece138c7c1afdc6825302f0f62d81f draft
147 | o 2 cd2534766bece138c7c1afdc6825302f0f62d81f draft
158 | |
148 | |
159 | o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
149 | o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
160 |/
150 |/
161 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
151 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
162
152
163
153
164 All manifests should have been transferred
154 All manifests should have been transferred
165
155
166 $ hg -R client-simple debugindex -m
156 $ hg -R client-simple debugindex -m
167 rev linkrev nodeid p1 p2
157 rev linkrev nodeid p1 p2
168 0 0 992f4779029a 000000000000 000000000000
158 0 0 992f4779029a 000000000000 000000000000
169 1 1 a988fb43583e 992f4779029a 000000000000
159 1 1 a988fb43583e 992f4779029a 000000000000
170 2 2 ec804e488c20 a988fb43583e 000000000000
160 2 2 ec804e488c20 a988fb43583e 000000000000
171 3 3 045c7f3927da 992f4779029a 000000000000
161 3 3 045c7f3927da 992f4779029a 000000000000
172 4 4 379cb0c2e664 045c7f3927da 000000000000
162 4 4 379cb0c2e664 045c7f3927da 000000000000
173
163
174 Cloning only a specific revision works
164 Cloning only a specific revision works
175
165
176 $ hg --debug clone -U -r 4432d83626e8 http://localhost:$HGPORT client-singlehead
166 $ hg --debug clone -U -r 4432d83626e8 http://localhost:$HGPORT client-singlehead
177 using http://localhost:$HGPORT/
167 using http://localhost:$HGPORT/
178 sending capabilities command
168 sending capabilities command
179 sending 1 commands
169 sending 1 commands
180 sending command lookup: {
170 sending command lookup: {
181 'key': '4432d83626e8'
171 'key': '4432d83626e8'
182 }
172 }
183 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
173 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
184 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
174 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
185 received frame(size=21; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
175 received frame(size=21; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
186 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
176 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
187 query 1; heads
177 query 1; heads
188 sending 2 commands
178 sending 2 commands
189 sending command heads: {}
179 sending command heads: {}
190 sending command known: {
180 sending command known: {
191 'nodes': []
181 'nodes': []
192 }
182 }
193 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
183 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
194 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
184 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
195 received frame(size=43; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
185 received frame(size=43; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
196 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
186 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
197 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
187 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
198 received frame(size=1; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
188 received frame(size=1; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
199 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
189 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
200 sending 1 commands
190 sending 1 commands
201 sending command changesetdata: {
191 sending command changesetdata: {
202 'fields': set([
192 'fields': set([
203 'bookmarks',
193 'bookmarks',
204 'parents',
194 'parents',
205 'phase',
195 'phase',
206 'revision'
196 'revision'
207 ]),
197 ]),
208 'revisions': [
198 'revisions': [
209 {
199 {
210 'heads': [
200 'heads': [
211 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0'
201 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0'
212 ],
202 ],
213 'roots': [],
203 'roots': [],
214 'type': 'changesetdagrange'
204 'type': 'changesetdagrange'
215 }
205 }
216 ]
206 ]
217 }
207 }
218 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
208 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
219 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
209 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
220 received frame(size=381; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
210 received frame(size=381; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
221 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
211 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
222 add changeset 3390ef850073
212 add changeset 3390ef850073
223 add changeset 4432d83626e8
213 add changeset 4432d83626e8
224 checking for updated bookmarks
214 checking for updated bookmarks
225 sending 1 commands
215 sending 1 commands
226 sending command manifestdata: {
216 sending command manifestdata: {
227 'fields': set([
217 'fields': set([
228 'parents',
218 'parents',
229 'revision'
219 'revision'
230 ]),
220 ]),
231 'haveparents': True,
221 'haveparents': True,
232 'nodes': [
222 'nodes': [
233 '\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A',
223 '\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A',
234 '\xa9\x88\xfbCX>\x87\x1d\x1e\xd5u\x0e\xe0t\xc6\xd8@\xbb\xbf\xc8'
224 '\xa9\x88\xfbCX>\x87\x1d\x1e\xd5u\x0e\xe0t\xc6\xd8@\xbb\xbf\xc8'
235 ],
225 ],
236 'tree': ''
226 'tree': ''
237 }
227 }
238 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
228 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
239 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
229 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
240 received frame(size=404; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
230 received frame(size=404; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
241 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
231 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
242 sending 2 commands
232 sending 1 commands
243 sending command filedata: {
233 sending command filesdata: {
244 'fields': set([
234 'fields': set([
245 'parents',
235 'parents',
246 'revision'
236 'revision'
247 ]),
237 ]),
248 'haveparents': True,
238 'haveparents': True,
249 'nodes': [
239 'revisions': [
250 '+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda',
240 {
251 '\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc'
241 'nodes': [
252 ],
242 '3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:',
253 'path': 'a'
243 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0'
254 }
244 ],
255 sending command filedata: {
245 'type': 'changesetexplicit'
256 'fields': set([
246 }
257 'parents',
247 ]
258 'revision'
259 ]),
260 'haveparents': True,
261 'nodes': [
262 '\x81\x9e%\x8d1\xa5\xe1`f)\xf3e\xbb\x90*\x1b!\xeeB\x16'
263 ],
264 'path': 'b'
265 }
248 }
266 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
249 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
267 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
250 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
268 received frame(size=277; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
251 received frame(size=439; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
269 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
252 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
270 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
271 received frame(size=123; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
272 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
273 updating the branch cache
253 updating the branch cache
274 new changesets 3390ef850073:4432d83626e8
254 new changesets 3390ef850073:4432d83626e8
275 (sent 6 HTTP requests and * bytes; received * bytes in responses) (glob)
255 (sent 6 HTTP requests and * bytes; received * bytes in responses) (glob)
276
256
277 $ cd client-singlehead
257 $ cd client-singlehead
278
258
279 $ hg log -G -T '{rev} {node} {phase}\n'
259 $ hg log -G -T '{rev} {node} {phase}\n'
280 o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
260 o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
281 |
261 |
282 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
262 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
283
263
284
264
285 $ hg debugindex -m
265 $ hg debugindex -m
286 rev linkrev nodeid p1 p2
266 rev linkrev nodeid p1 p2
287 0 0 992f4779029a 000000000000 000000000000
267 0 0 992f4779029a 000000000000 000000000000
288 1 1 a988fb43583e 992f4779029a 000000000000
268 1 1 a988fb43583e 992f4779029a 000000000000
289
269
290 Incremental pull works
270 Incremental pull works
291
271
292 $ hg --debug pull
272 $ hg --debug pull
293 pulling from http://localhost:$HGPORT/
273 pulling from http://localhost:$HGPORT/
294 using http://localhost:$HGPORT/
274 using http://localhost:$HGPORT/
295 sending capabilities command
275 sending capabilities command
296 query 1; heads
276 query 1; heads
297 sending 2 commands
277 sending 2 commands
298 sending command heads: {}
278 sending command heads: {}
299 sending command known: {
279 sending command known: {
300 'nodes': [
280 'nodes': [
301 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0'
281 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0'
302 ]
282 ]
303 }
283 }
304 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
284 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
305 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
285 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
306 received frame(size=43; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
286 received frame(size=43; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
307 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
287 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
308 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
288 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
309 received frame(size=2; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
289 received frame(size=2; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
310 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
290 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
311 searching for changes
291 searching for changes
312 all local heads known remotely
292 all local heads known remotely
313 sending 1 commands
293 sending 1 commands
314 sending command changesetdata: {
294 sending command changesetdata: {
315 'fields': set([
295 'fields': set([
316 'bookmarks',
296 'bookmarks',
317 'parents',
297 'parents',
318 'phase',
298 'phase',
319 'revision'
299 'revision'
320 ]),
300 ]),
321 'revisions': [
301 'revisions': [
322 {
302 {
323 'heads': [
303 'heads': [
324 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
304 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
325 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
305 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
326 ],
306 ],
327 'roots': [
307 'roots': [
328 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0'
308 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0'
329 ],
309 ],
330 'type': 'changesetdagrange'
310 'type': 'changesetdagrange'
331 }
311 }
332 ]
312 ]
333 }
313 }
334 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
314 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
335 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
315 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
336 received frame(size=573; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
316 received frame(size=573; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
337 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
317 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
338 add changeset cd2534766bec
318 add changeset cd2534766bec
339 add changeset e96ae20f4188
319 add changeset e96ae20f4188
340 add changeset caa2a465451d
320 add changeset caa2a465451d
341 checking for updated bookmarks
321 checking for updated bookmarks
342 sending 1 commands
322 sending 1 commands
343 sending command manifestdata: {
323 sending command manifestdata: {
344 'fields': set([
324 'fields': set([
345 'parents',
325 'parents',
346 'revision'
326 'revision'
347 ]),
327 ]),
348 'haveparents': True,
328 'haveparents': True,
349 'nodes': [
329 'nodes': [
350 '\xec\x80NH\x8c \x88\xc25\t\x9a\x10 u\x13\xbe\xcd\xc3\xdd\xa5',
330 '\xec\x80NH\x8c \x88\xc25\t\x9a\x10 u\x13\xbe\xcd\xc3\xdd\xa5',
351 '\x04\\\x7f9\'\xda\x13\xe7Z\xf8\xf0\xe4\xf0HI\xe4a\xa9x\x0f',
331 '\x04\\\x7f9\'\xda\x13\xe7Z\xf8\xf0\xe4\xf0HI\xe4a\xa9x\x0f',
352 '7\x9c\xb0\xc2\xe6d\\y\xdd\xc5\x9a\x1dG\'\xa9\xfb\x83\n\xeb&'
332 '7\x9c\xb0\xc2\xe6d\\y\xdd\xc5\x9a\x1dG\'\xa9\xfb\x83\n\xeb&'
353 ],
333 ],
354 'tree': ''
334 'tree': ''
355 }
335 }
356 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
336 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
357 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
337 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
358 received frame(size=601; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
338 received frame(size=601; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
359 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
339 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
360 sending 2 commands
340 sending 1 commands
361 sending command filedata: {
341 sending command filesdata: {
362 'fields': set([
342 'fields': set([
363 'parents',
343 'parents',
364 'revision'
344 'revision'
365 ]),
345 ]),
366 'haveparents': True,
346 'haveparents': True,
367 'nodes': [
347 'revisions': [
368 '+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda',
348 {
369 '\xc2\xa2\x05\xc8\xb2\xad\xe2J\xf2`b\xe5<\xd5\xbc8\x01\xd6`\xda'
349 'nodes': [
370 ],
350 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f',
371 'path': 'a'
351 '\xe9j\xe2\x0fA\x88H{\x9a\xe4\xef9A\xc2|\x81\x141F\xe5',
372 }
352 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1'
373 sending command filedata: {
353 ],
374 'fields': set([
354 'type': 'changesetexplicit'
375 'parents',
355 }
376 'revision'
356 ]
377 ]),
378 'haveparents': True,
379 'nodes': [
380 '\x81\x9e%\x8d1\xa5\xe1`f)\xf3e\xbb\x90*\x1b!\xeeB\x16',
381 '\xb1zk\xd3g=\x9a\xb8\xce\xd5\x81\xa2\t\xf6/=\xa5\xccEx',
382 '\xc5\xb1\xf9\xd3n\x1c\xc18\xbf\xb6\xef\xb3\xde\xb7]\x8c\xcad\x94\xc3'
383 ],
384 'path': 'b'
385 }
357 }
386 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
358 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
387 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
359 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
388 received frame(size=277; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
360 received frame(size=527; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
389 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
361 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
390 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
391 received frame(size=431; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
392 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
393 updating the branch cache
362 updating the branch cache
394 new changesets cd2534766bec:caa2a465451d (3 drafts)
363 new changesets cd2534766bec:caa2a465451d (3 drafts)
395 (run 'hg update' to get a working copy)
364 (run 'hg update' to get a working copy)
396 (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
365 (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
397
366
398 $ hg log -G -T '{rev} {node} {phase}\n'
367 $ hg log -G -T '{rev} {node} {phase}\n'
399 o 4 caa2a465451dd1facda0f5b12312c355584188a1 draft
368 o 4 caa2a465451dd1facda0f5b12312c355584188a1 draft
400 |
369 |
401 o 3 e96ae20f4188487b9ae4ef3941c27c81143146e5 draft
370 o 3 e96ae20f4188487b9ae4ef3941c27c81143146e5 draft
402 |
371 |
403 | o 2 cd2534766bece138c7c1afdc6825302f0f62d81f draft
372 | o 2 cd2534766bece138c7c1afdc6825302f0f62d81f draft
404 | |
373 | |
405 | o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
374 | o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
406 |/
375 |/
407 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
376 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
408
377
409
378
410 $ hg debugindex -m
379 $ hg debugindex -m
411 rev linkrev nodeid p1 p2
380 rev linkrev nodeid p1 p2
412 0 0 992f4779029a 000000000000 000000000000
381 0 0 992f4779029a 000000000000 000000000000
413 1 1 a988fb43583e 992f4779029a 000000000000
382 1 1 a988fb43583e 992f4779029a 000000000000
414 2 2 ec804e488c20 a988fb43583e 000000000000
383 2 2 ec804e488c20 a988fb43583e 000000000000
415 3 3 045c7f3927da 992f4779029a 000000000000
384 3 3 045c7f3927da 992f4779029a 000000000000
416 4 4 379cb0c2e664 045c7f3927da 000000000000
385 4 4 379cb0c2e664 045c7f3927da 000000000000
417
386
418 Phase-only update works
387 Phase-only update works
419 TODO this doesn't work
388 TODO this doesn't work
420
389
421 $ hg -R ../server-simple phase --public -r caa2a465451dd
390 $ hg -R ../server-simple phase --public -r caa2a465451dd
422 $ hg --debug pull
391 $ hg --debug pull
423 pulling from http://localhost:$HGPORT/
392 pulling from http://localhost:$HGPORT/
424 using http://localhost:$HGPORT/
393 using http://localhost:$HGPORT/
425 sending capabilities command
394 sending capabilities command
426 query 1; heads
395 query 1; heads
427 sending 2 commands
396 sending 2 commands
428 sending command heads: {}
397 sending command heads: {}
429 sending command known: {
398 sending command known: {
430 'nodes': [
399 'nodes': [
431 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f',
400 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f',
432 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1'
401 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1'
433 ]
402 ]
434 }
403 }
435 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
404 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
436 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
405 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
437 received frame(size=43; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
406 received frame(size=43; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
438 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
407 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
439 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
408 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
440 received frame(size=3; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
409 received frame(size=3; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
441 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
410 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
442 searching for changes
411 searching for changes
443 all remote heads known locally
412 all remote heads known locally
444 sending 1 commands
413 sending 1 commands
445 sending command changesetdata: {
414 sending command changesetdata: {
446 'fields': set([
415 'fields': set([
447 'bookmarks',
416 'bookmarks',
448 'parents',
417 'parents',
449 'phase',
418 'phase',
450 'revision'
419 'revision'
451 ]),
420 ]),
452 'revisions': [
421 'revisions': [
453 {
422 {
454 'heads': [
423 'heads': [
455 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
424 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
456 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
425 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
457 ],
426 ],
458 'roots': [
427 'roots': [
459 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
428 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
460 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
429 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
461 ],
430 ],
462 'type': 'changesetdagrange'
431 'type': 'changesetdagrange'
463 }
432 }
464 ]
433 ]
465 }
434 }
466 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
435 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
467 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
436 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
468 received frame(size=13; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
437 received frame(size=13; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
469 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
438 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
470 checking for updated bookmarks
439 checking for updated bookmarks
471 (run 'hg update' to get a working copy)
440 (run 'hg update' to get a working copy)
472 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
441 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
473
442
474 $ hg log -G -T '{rev} {node} {phase}\n'
443 $ hg log -G -T '{rev} {node} {phase}\n'
475 o 4 caa2a465451dd1facda0f5b12312c355584188a1 draft
444 o 4 caa2a465451dd1facda0f5b12312c355584188a1 draft
476 |
445 |
477 o 3 e96ae20f4188487b9ae4ef3941c27c81143146e5 draft
446 o 3 e96ae20f4188487b9ae4ef3941c27c81143146e5 draft
478 |
447 |
479 | o 2 cd2534766bece138c7c1afdc6825302f0f62d81f draft
448 | o 2 cd2534766bece138c7c1afdc6825302f0f62d81f draft
480 | |
449 | |
481 | o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
450 | o 1 4432d83626e8a98655f062ec1f2a43b07f7fbbb0 public
482 |/
451 |/
483 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
452 o 0 3390ef850073fbc2f0dfff2244342c8e9229013a public
484
453
485
454
486 $ cd ..
455 $ cd ..
487
456
488 Bookmarks are transferred on clone
457 Bookmarks are transferred on clone
489
458
490 $ hg -R server-simple bookmark -r 3390ef850073fbc2f0dfff2244342c8e9229013a book-1
459 $ hg -R server-simple bookmark -r 3390ef850073fbc2f0dfff2244342c8e9229013a book-1
491 $ hg -R server-simple bookmark -r cd2534766bece138c7c1afdc6825302f0f62d81f book-2
460 $ hg -R server-simple bookmark -r cd2534766bece138c7c1afdc6825302f0f62d81f book-2
492
461
493 $ hg --debug clone -U http://localhost:$HGPORT/ client-bookmarks
462 $ hg --debug clone -U http://localhost:$HGPORT/ client-bookmarks
494 using http://localhost:$HGPORT/
463 using http://localhost:$HGPORT/
495 sending capabilities command
464 sending capabilities command
496 query 1; heads
465 query 1; heads
497 sending 2 commands
466 sending 2 commands
498 sending command heads: {}
467 sending command heads: {}
499 sending command known: {
468 sending command known: {
500 'nodes': []
469 'nodes': []
501 }
470 }
502 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
471 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
503 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
472 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
504 received frame(size=43; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
473 received frame(size=43; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
505 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
474 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
506 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
475 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
507 received frame(size=1; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
476 received frame(size=1; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
508 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
477 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
509 sending 1 commands
478 sending 1 commands
510 sending command changesetdata: {
479 sending command changesetdata: {
511 'fields': set([
480 'fields': set([
512 'bookmarks',
481 'bookmarks',
513 'parents',
482 'parents',
514 'phase',
483 'phase',
515 'revision'
484 'revision'
516 ]),
485 ]),
517 'revisions': [
486 'revisions': [
518 {
487 {
519 'heads': [
488 'heads': [
520 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
489 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
521 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
490 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
522 ],
491 ],
523 'roots': [],
492 'roots': [],
524 'type': 'changesetdagrange'
493 'type': 'changesetdagrange'
525 }
494 }
526 ]
495 ]
527 }
496 }
528 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
497 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
529 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
498 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
530 received frame(size=979; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
499 received frame(size=979; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
531 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
500 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
532 add changeset 3390ef850073
501 add changeset 3390ef850073
533 add changeset 4432d83626e8
502 add changeset 4432d83626e8
534 add changeset cd2534766bec
503 add changeset cd2534766bec
535 add changeset e96ae20f4188
504 add changeset e96ae20f4188
536 add changeset caa2a465451d
505 add changeset caa2a465451d
537 checking for updated bookmarks
506 checking for updated bookmarks
538 adding remote bookmark book-1
507 adding remote bookmark book-1
539 adding remote bookmark book-2
508 adding remote bookmark book-2
540 sending 1 commands
509 sending 1 commands
541 sending command manifestdata: {
510 sending command manifestdata: {
542 'fields': set([
511 'fields': set([
543 'parents',
512 'parents',
544 'revision'
513 'revision'
545 ]),
514 ]),
546 'haveparents': True,
515 'haveparents': True,
547 'nodes': [
516 'nodes': [
548 '\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A',
517 '\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A',
549 '\xa9\x88\xfbCX>\x87\x1d\x1e\xd5u\x0e\xe0t\xc6\xd8@\xbb\xbf\xc8',
518 '\xa9\x88\xfbCX>\x87\x1d\x1e\xd5u\x0e\xe0t\xc6\xd8@\xbb\xbf\xc8',
550 '\xec\x80NH\x8c \x88\xc25\t\x9a\x10 u\x13\xbe\xcd\xc3\xdd\xa5',
519 '\xec\x80NH\x8c \x88\xc25\t\x9a\x10 u\x13\xbe\xcd\xc3\xdd\xa5',
551 '\x04\\\x7f9\'\xda\x13\xe7Z\xf8\xf0\xe4\xf0HI\xe4a\xa9x\x0f',
520 '\x04\\\x7f9\'\xda\x13\xe7Z\xf8\xf0\xe4\xf0HI\xe4a\xa9x\x0f',
552 '7\x9c\xb0\xc2\xe6d\\y\xdd\xc5\x9a\x1dG\'\xa9\xfb\x83\n\xeb&'
521 '7\x9c\xb0\xc2\xe6d\\y\xdd\xc5\x9a\x1dG\'\xa9\xfb\x83\n\xeb&'
553 ],
522 ],
554 'tree': ''
523 'tree': ''
555 }
524 }
556 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
525 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
557 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
526 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
558 received frame(size=992; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
527 received frame(size=992; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
559 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
528 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
560 sending 2 commands
529 sending 1 commands
561 sending command filedata: {
530 sending command filesdata: {
562 'fields': set([
531 'fields': set([
563 'parents',
532 'parents',
564 'revision'
533 'revision'
565 ]),
534 ]),
566 'haveparents': True,
535 'haveparents': True,
567 'nodes': [
536 'revisions': [
568 '+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda',
537 {
569 '\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc',
538 'nodes': [
570 '\xc2\xa2\x05\xc8\xb2\xad\xe2J\xf2`b\xe5<\xd5\xbc8\x01\xd6`\xda'
539 '3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:',
571 ],
540 'D2\xd86&\xe8\xa9\x86U\xf0b\xec\x1f*C\xb0\x7f\x7f\xbb\xb0',
572 'path': 'a'
541 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f',
573 }
542 '\xe9j\xe2\x0fA\x88H{\x9a\xe4\xef9A\xc2|\x81\x141F\xe5',
574 sending command filedata: {
543 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1'
575 'fields': set([
544 ],
576 'parents',
545 'type': 'changesetexplicit'
577 'revision'
546 }
578 ]),
547 ]
579 'haveparents': True,
580 'nodes': [
581 '\x81\x9e%\x8d1\xa5\xe1`f)\xf3e\xbb\x90*\x1b!\xeeB\x16',
582 '\xb1zk\xd3g=\x9a\xb8\xce\xd5\x81\xa2\t\xf6/=\xa5\xccEx',
583 '\xc5\xb1\xf9\xd3n\x1c\xc18\xbf\xb6\xef\xb3\xde\xb7]\x8c\xcad\x94\xc3'
584 ],
585 'path': 'b'
586 }
548 }
587 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
549 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
588 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
550 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
589 received frame(size=431; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
551 received frame(size=901; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
590 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
552 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
591 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
592 received frame(size=431; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
593 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
594 updating the branch cache
553 updating the branch cache
595 new changesets 3390ef850073:caa2a465451d (1 drafts)
554 new changesets 3390ef850073:caa2a465451d (1 drafts)
596 (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
555 (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
597
556
598 $ hg -R client-bookmarks bookmarks
557 $ hg -R client-bookmarks bookmarks
599 book-1 0:3390ef850073
558 book-1 0:3390ef850073
600 book-2 2:cd2534766bec
559 book-2 2:cd2534766bec
601
560
602 Server-side bookmark moves are reflected during `hg pull`
561 Server-side bookmark moves are reflected during `hg pull`
603
562
604 $ hg -R server-simple bookmark -r cd2534766bece138c7c1afdc6825302f0f62d81f book-1
563 $ hg -R server-simple bookmark -r cd2534766bece138c7c1afdc6825302f0f62d81f book-1
605 moving bookmark 'book-1' forward from 3390ef850073
564 moving bookmark 'book-1' forward from 3390ef850073
606
565
607 $ hg -R client-bookmarks --debug pull
566 $ hg -R client-bookmarks --debug pull
608 pulling from http://localhost:$HGPORT/
567 pulling from http://localhost:$HGPORT/
609 using http://localhost:$HGPORT/
568 using http://localhost:$HGPORT/
610 sending capabilities command
569 sending capabilities command
611 query 1; heads
570 query 1; heads
612 sending 2 commands
571 sending 2 commands
613 sending command heads: {}
572 sending command heads: {}
614 sending command known: {
573 sending command known: {
615 'nodes': [
574 'nodes': [
616 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f',
575 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f',
617 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1'
576 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1'
618 ]
577 ]
619 }
578 }
620 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
579 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
621 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
580 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
622 received frame(size=43; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
581 received frame(size=43; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
623 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
582 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
624 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
583 received frame(size=11; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
625 received frame(size=3; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
584 received frame(size=3; request=3; stream=2; streamflags=encoded; type=command-response; flags=continuation)
626 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
585 received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
627 searching for changes
586 searching for changes
628 all remote heads known locally
587 all remote heads known locally
629 sending 1 commands
588 sending 1 commands
630 sending command changesetdata: {
589 sending command changesetdata: {
631 'fields': set([
590 'fields': set([
632 'bookmarks',
591 'bookmarks',
633 'parents',
592 'parents',
634 'phase',
593 'phase',
635 'revision'
594 'revision'
636 ]),
595 ]),
637 'revisions': [
596 'revisions': [
638 {
597 {
639 'heads': [
598 'heads': [
640 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
599 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
641 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
600 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
642 ],
601 ],
643 'roots': [
602 'roots': [
644 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
603 '\xca\xa2\xa4eE\x1d\xd1\xfa\xcd\xa0\xf5\xb1#\x12\xc3UXA\x88\xa1',
645 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
604 '\xcd%4vk\xec\xe18\xc7\xc1\xaf\xdch%0/\x0fb\xd8\x1f'
646 ],
605 ],
647 'type': 'changesetdagrange'
606 'type': 'changesetdagrange'
648 }
607 }
649 ]
608 ]
650 }
609 }
651 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
610 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos)
652 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
611 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
653 received frame(size=65; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
612 received frame(size=65; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation)
654 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
613 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
655 checking for updated bookmarks
614 checking for updated bookmarks
656 updating bookmark book-1
615 updating bookmark book-1
657 (run 'hg update' to get a working copy)
616 (run 'hg update' to get a working copy)
658 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
617 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
659
618
660 $ hg -R client-bookmarks bookmarks
619 $ hg -R client-bookmarks bookmarks
661 book-1 2:cd2534766bec
620 book-1 2:cd2534766bec
662 book-2 2:cd2534766bec
621 book-2 2:cd2534766bec
General Comments 0
You need to be logged in to leave comments. Login now