Show More
@@ -158,6 +158,7 b' from .i18n import _' | |||||
158 | from . import ( |
|
158 | from . import ( | |
159 | bookmarks, |
|
159 | bookmarks, | |
160 | changegroup, |
|
160 | changegroup, | |
|
161 | encoding, | |||
161 | error, |
|
162 | error, | |
162 | node as nodemod, |
|
163 | node as nodemod, | |
163 | obsolete, |
|
164 | obsolete, | |
@@ -2129,6 +2130,40 b' def handlehgtagsfnodes(op, inpart):' | |||||
2129 | cache.write() |
|
2130 | cache.write() | |
2130 | op.ui.debug('applied %i hgtags fnodes cache entries\n' % count) |
|
2131 | op.ui.debug('applied %i hgtags fnodes cache entries\n' % count) | |
2131 |
|
2132 | |||
|
2133 | rbcstruct = struct.Struct('>III') | |||
|
2134 | ||||
|
2135 | @parthandler('cache:rev-branch-cache') | |||
|
2136 | def handlerbc(op, inpart): | |||
|
2137 | """receive a rev-branch-cache payload and update the local cache | |||
|
2138 | ||||
|
2139 | The payload is a series of data related to each branch | |||
|
2140 | ||||
|
2141 | 1) branch name length | |||
|
2142 | 2) number of open heads | |||
|
2143 | 3) number of closed heads | |||
|
2144 | 4) open heads nodes | |||
|
2145 | 5) closed heads nodes | |||
|
2146 | """ | |||
|
2147 | total = 0 | |||
|
2148 | rawheader = inpart.read(rbcstruct.size) | |||
|
2149 | cache = op.repo.revbranchcache() | |||
|
2150 | cl = op.repo.unfiltered().changelog | |||
|
2151 | while rawheader: | |||
|
2152 | header = rbcstruct.unpack(rawheader) | |||
|
2153 | total += header[1] + header[2] | |||
|
2154 | utf8branch = inpart.read(header[0]) | |||
|
2155 | branch = encoding.tolocal(utf8branch) | |||
|
2156 | for x in xrange(header[1]): | |||
|
2157 | node = inpart.read(20) | |||
|
2158 | rev = cl.rev(node) | |||
|
2159 | cache.setdata(branch, rev, node, False) | |||
|
2160 | for x in xrange(header[2]): | |||
|
2161 | node = inpart.read(20) | |||
|
2162 | rev = cl.rev(node) | |||
|
2163 | cache.setdata(branch, rev, node, True) | |||
|
2164 | rawheader = inpart.read(rbcstruct.size) | |||
|
2165 | cache.write() | |||
|
2166 | ||||
2132 | @parthandler('pushvars') |
|
2167 | @parthandler('pushvars') | |
2133 | def bundle2getvars(op, part): |
|
2168 | def bundle2getvars(op, part): | |
2134 | '''unbundle a bundle2 containing shellvars on the server''' |
|
2169 | '''unbundle a bundle2 containing shellvars on the server''' |
General Comments 0
You need to be logged in to leave comments.
Login now