comparison mercurial/bundle2.py @ 42417:a97b12f726e4

narrow: pass the bundle to bundle2.widen_bundle() instead of generating there This will make the code in narrowwirepeer.py more better for further refactoring. Differential Revision: https://phab.mercurial-scm.org/D6438
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 23 May 2019 03:03:36 +0530
parents 29569f2db929
children 38392d5bde8e
comparison
equal deleted inserted replaced
42416:8381b7067f17 42417:a97b12f726e4
2296 2296
2297 repo.ui.debug('applying stream bundle\n') 2297 repo.ui.debug('applying stream bundle\n')
2298 streamclone.applybundlev2(repo, part, filecount, bytecount, 2298 streamclone.applybundlev2(repo, part, filecount, bytecount,
2299 requirements) 2299 requirements)
2300 2300
2301 def widen_bundle(repo, oldmatcher, newmatcher, common, known, cgversion, 2301 def widen_bundle(bundler, repo, oldmatcher, newmatcher, common,
2302 ellipses): 2302 known, cgversion, ellipses):
2303 """generates bundle2 for widening a narrow clone 2303 """generates bundle2 for widening a narrow clone
2304 2304
2305 bundler is the bundle to which data should be added
2305 repo is the localrepository instance 2306 repo is the localrepository instance
2306 oldmatcher matches what the client already has 2307 oldmatcher matches what the client already has
2307 newmatcher matches what the client needs (including what it already has) 2308 newmatcher matches what the client needs (including what it already has)
2308 common is set of common heads between server and client 2309 common is set of common heads between server and client
2309 known is a set of revs known on the client side (used in ellipses) 2310 known is a set of revs known on the client side (used in ellipses)
2310 cgversion is the changegroup version to send 2311 cgversion is the changegroup version to send
2311 ellipses is boolean value telling whether to send ellipses data or not 2312 ellipses is boolean value telling whether to send ellipses data or not
2312 2313
2313 returns bundle2 of the data required for extending 2314 returns bundle2 of the data required for extending
2314 """ 2315 """
2315 bundler = bundle20(repo.ui)
2316 commonnodes = set() 2316 commonnodes = set()
2317 cl = repo.changelog 2317 cl = repo.changelog
2318 for r in repo.revs("::%ln", common): 2318 for r in repo.revs("::%ln", common):
2319 commonnodes.add(cl.node(r)) 2319 commonnodes.add(cl.node(r))
2320 if commonnodes: 2320 if commonnodes: