342 pass |
342 pass |
343 return other, [], other.close |
343 return other, [], other.close |
344 |
344 |
345 bundle = None |
345 bundle = None |
346 bundlerepo = None |
346 bundlerepo = None |
347 localrepo = other |
347 localrepo = other.local() |
348 if bundlename or not other.local(): |
348 if bundlename or not localrepo: |
349 # create a bundle (uncompressed if other repo is not local) |
349 # create a bundle (uncompressed if other repo is not local) |
350 |
350 |
351 if other.capable('getbundle'): |
351 if other.capable('getbundle'): |
352 cg = other.getbundle('incoming', common=common, heads=rheads) |
352 cg = other.getbundle('incoming', common=common, heads=rheads) |
353 elif onlyheads is None and not other.capable('changegroupsubset'): |
353 elif onlyheads is None and not other.capable('changegroupsubset'): |
354 # compat with older servers when pulling all remote heads |
354 # compat with older servers when pulling all remote heads |
355 cg = other.changegroup(incoming, "incoming") |
355 cg = other.changegroup(incoming, "incoming") |
356 rheads = None |
356 rheads = None |
357 else: |
357 else: |
358 cg = other.changegroupsubset(incoming, rheads, 'incoming') |
358 cg = other.changegroupsubset(incoming, rheads, 'incoming') |
359 bundletype = other.local() and "HG10BZ" or "HG10UN" |
359 bundletype = localrepo and "HG10BZ" or "HG10UN" |
360 fname = bundle = changegroup.writebundle(cg, bundlename, bundletype) |
360 fname = bundle = changegroup.writebundle(cg, bundlename, bundletype) |
361 # keep written bundle? |
361 # keep written bundle? |
362 if bundlename: |
362 if bundlename: |
363 bundle = None |
363 bundle = None |
364 if not other.local(): |
364 if not localrepo: |
365 # use the created uncompressed bundlerepo |
365 # use the created uncompressed bundlerepo |
366 localrepo = bundlerepo = bundlerepository(ui, repo.root, fname) |
366 localrepo = bundlerepo = bundlerepository(ui, repo.root, fname) |
367 # this repo contains local and other now, so filter out local again |
367 # this repo contains local and other now, so filter out local again |
368 common = repo.heads() |
368 common = repo.heads() |
369 |
369 |