##// END OF EJS Templates
rev-branch-cache: add a function to generate a part...
Boris Feld -
r36982:79b73be4 default
parent child Browse files
Show More
@@ -147,6 +147,7 b' preserve.'
147
147
148 from __future__ import absolute_import, division
148 from __future__ import absolute_import, division
149
149
150 import collections
150 import errno
151 import errno
151 import os
152 import os
152 import re
153 import re
@@ -1624,6 +1625,28 b' def addparttagsfnodescache(repo, bundler'
1624 if chunks:
1625 if chunks:
1625 bundler.newpart('hgtagsfnodes', data=''.join(chunks))
1626 bundler.newpart('hgtagsfnodes', data=''.join(chunks))
1626
1627
1628 def addpartrevbranchcache(repo, bundler, outgoing):
1629 # we include the rev branch cache for the bundle changeset
1630 # (as an optional parts)
1631 cache = repo.revbranchcache()
1632 cl = repo.unfiltered().changelog
1633 branchesdata = collections.defaultdict(lambda: (set(), set()))
1634 for node in outgoing.missing:
1635 branch, close = cache.branchinfo(cl.rev(node))
1636 branchesdata[branch][close].add(node)
1637
1638 def generate():
1639 for branch, (nodes, closed) in sorted(branchesdata.items()):
1640 utf8branch = encoding.fromlocal(branch)
1641 yield rbcstruct.pack(len(utf8branch), len(nodes), len(closed))
1642 yield utf8branch
1643 for n in sorted(nodes):
1644 yield n
1645 for n in sorted(closed):
1646 yield n
1647
1648 bundler.newpart('cache:rev-branch-cache', data=generate())
1649
1627 def buildobsmarkerspart(bundler, markers):
1650 def buildobsmarkerspart(bundler, markers):
1628 """add an obsmarker part to the bundler with <markers>
1651 """add an obsmarker part to the bundler with <markers>
1629
1652
General Comments 0
You need to be logged in to leave comments. Login now