mercurial/bundle2.py
changeset 40344 2c5835b4246b
parent 40338 af62936c2508
child 40372 81c80ed7c991
equal deleted inserted replaced
40343:a69d5823af6d 40344:2c5835b4246b
  2276 
  2276 
  2277     repo.ui.debug('applying stream bundle\n')
  2277     repo.ui.debug('applying stream bundle\n')
  2278     streamclone.applybundlev2(repo, part, filecount, bytecount,
  2278     streamclone.applybundlev2(repo, part, filecount, bytecount,
  2279                               requirements)
  2279                               requirements)
  2280 
  2280 
  2281 def widen_bundle(repo, diffmatcher, common, known, cgversion, ellipses):
  2281 def widen_bundle(repo, oldmatcher, newmatcher, common, known, cgversion,
       
  2282                  ellipses):
  2282     """generates bundle2 for widening a narrow clone
  2283     """generates bundle2 for widening a narrow clone
  2283 
  2284 
  2284     repo is the localrepository instance
  2285     repo is the localrepository instance
  2285     diffmatcher is a differencemacther of '(newincludes, newexcludes) -
  2286     oldmatcher matches what the client already has
  2286     (oldincludes, oldexcludes)'
  2287     newmatcher matches what the client needs (including what it already has)
  2287     common is set of common heads between server and client
  2288     common is set of common heads between server and client
  2288     known is a set of revs known on the client side (used in ellipses)
  2289     known is a set of revs known on the client side (used in ellipses)
  2289     cgversion is the changegroup version to send
  2290     cgversion is the changegroup version to send
  2290     ellipses is boolean value telling whether to send ellipses data or not
  2291     ellipses is boolean value telling whether to send ellipses data or not
  2291 
  2292 
  2298         commonnodes.add(cl.node(r))
  2299         commonnodes.add(cl.node(r))
  2299     if commonnodes:
  2300     if commonnodes:
  2300         # XXX: we should only send the filelogs (and treemanifest). user
  2301         # XXX: we should only send the filelogs (and treemanifest). user
  2301         # already has the changelog and manifest
  2302         # already has the changelog and manifest
  2302         packer = changegroup.getbundler(cgversion, repo,
  2303         packer = changegroup.getbundler(cgversion, repo,
  2303                                         filematcher=diffmatcher,
  2304                                         oldmatcher=oldmatcher,
       
  2305                                         matcher=newmatcher,
  2304                                         fullnodes=commonnodes)
  2306                                         fullnodes=commonnodes)
  2305         cgdata = packer.generate(set([nodemod.nullid]), list(commonnodes),
  2307         cgdata = packer.generate(set([nodemod.nullid]), list(commonnodes),
  2306                                  False, 'narrow_widen', changelog=False)
  2308                                  False, 'narrow_widen', changelog=False)
  2307 
  2309 
  2308         part = bundler.newpart('changegroup', data=cgdata)
  2310         part = bundler.newpart('changegroup', data=cgdata)