324 bundlerepo = None |
324 bundlerepo = None |
325 localrepo = other |
325 localrepo = other |
326 if bundlename or not other.local(): |
326 if bundlename or not other.local(): |
327 # create a bundle (uncompressed if other repo is not local) |
327 # create a bundle (uncompressed if other repo is not local) |
328 |
328 |
329 if onlyheads is None and other.capable('changegroupsubset'): |
|
330 onlyheads = rheads |
|
331 |
|
332 if other.capable('getbundle'): |
329 if other.capable('getbundle'): |
333 cg = other.getbundle('incoming', common=common, heads=onlyheads) |
330 cg = other.getbundle('incoming', common=common, heads=rheads) |
334 elif onlyheads is None: |
331 elif onlyheads is None and not other.capable('changegroupsubset'): |
|
332 # compat with older servers when pulling all remote heads |
335 cg = other.changegroup(incoming, "incoming") |
333 cg = other.changegroup(incoming, "incoming") |
336 else: |
334 rheads = None |
337 cg = other.changegroupsubset(incoming, onlyheads, 'incoming') |
335 else: |
|
336 cg = other.changegroupsubset(incoming, rheads, 'incoming') |
338 bundletype = other.local() and "HG10BZ" or "HG10UN" |
337 bundletype = other.local() and "HG10BZ" or "HG10UN" |
339 fname = bundle = changegroup.writebundle(cg, bundlename, bundletype) |
338 fname = bundle = changegroup.writebundle(cg, bundlename, bundletype) |
340 # keep written bundle? |
339 # keep written bundle? |
341 if bundlename: |
340 if bundlename: |
342 bundle = None |
341 bundle = None |
344 # use the created uncompressed bundlerepo |
343 # use the created uncompressed bundlerepo |
345 localrepo = bundlerepo = bundlerepository(ui, repo.root, fname) |
344 localrepo = bundlerepo = bundlerepository(ui, repo.root, fname) |
346 # this repo contains local and other now, so filter out local again |
345 # this repo contains local and other now, so filter out local again |
347 common = repo.heads() |
346 common = repo.heads() |
348 |
347 |
349 csets = localrepo.changelog.findmissing(common, onlyheads) |
348 csets = localrepo.changelog.findmissing(common, rheads) |
350 |
349 |
351 def cleanup(): |
350 def cleanup(): |
352 if bundlerepo: |
351 if bundlerepo: |
353 bundlerepo.close() |
352 bundlerepo.close() |
354 if bundle: |
353 if bundle: |