1373 part.addparam('version', cg.version) |
1373 part.addparam('version', cg.version) |
1374 if 'clcount' in cg.extras: |
1374 if 'clcount' in cg.extras: |
1375 part.addparam('nbchanges', str(cg.extras['clcount']), |
1375 part.addparam('nbchanges', str(cg.extras['clcount']), |
1376 mandatory=False) |
1376 mandatory=False) |
1377 |
1377 |
|
1378 def addparttagsfnodescache(repo, bundler, outgoing): |
|
1379 # we include the tags fnode cache for the bundle changeset |
|
1380 # (as an optional parts) |
|
1381 cache = tags.hgtagsfnodescache(repo.unfiltered()) |
|
1382 chunks = [] |
|
1383 |
|
1384 # .hgtags fnodes are only relevant for head changesets. While we could |
|
1385 # transfer values for all known nodes, there will likely be little to |
|
1386 # no benefit. |
|
1387 # |
|
1388 # We don't bother using a generator to produce output data because |
|
1389 # a) we only have 40 bytes per head and even esoteric numbers of heads |
|
1390 # consume little memory (1M heads is 40MB) b) we don't want to send the |
|
1391 # part if we don't have entries and knowing if we have entries requires |
|
1392 # cache lookups. |
|
1393 for node in outgoing.missingheads: |
|
1394 # Don't compute missing, as this may slow down serving. |
|
1395 fnode = cache.getfnode(node, computemissing=False) |
|
1396 if fnode is not None: |
|
1397 chunks.extend([node, fnode]) |
|
1398 |
|
1399 if chunks: |
|
1400 bundler.newpart('hgtagsfnodes', data=''.join(chunks)) |
|
1401 |
1378 def writebundle(ui, cg, filename, bundletype, vfs=None, compression=None, |
1402 def writebundle(ui, cg, filename, bundletype, vfs=None, compression=None, |
1379 compopts=None): |
1403 compopts=None): |
1380 """Write a bundle file and return its filename. |
1404 """Write a bundle file and return its filename. |
1381 |
1405 |
1382 Existing files will not be overwritten. |
1406 Existing files will not be overwritten. |