Mercurial > public > mercurial-scm > hg
comparison mercurial/bundlerepo.py @ 14073:72c84f24b420
discovery: drop findoutgoing and simplify findcommonincoming's api
This is a long desired cleanup and paves the way for new discovery.
To specify subsets for bundling changes, all code should use the heads
of the desired subset ("heads") and the heads of the common subset
("common") to be excluded from the bundled set. These can be used
revlog.findmissing instead of revlog.nodesbetween.
This fixes an actual bug exposed by the change in test-bundle-r.t
where we try to bundle a changeset while specifying that said changeset
is to be assumed already present in the target. This used to still
bundle the changeset. It no longer does. This is similar to the bugs
fixed by the recent switch to heads/common for incoming/pull.
author | Peter Arrenbrecht <peter.arrenbrecht@gmail.com> |
---|---|
date | Sat, 30 Apr 2011 17:21:37 +0200 |
parents | 97ed99d1f419 |
children | 924c82157d46 |
comparison
equal
deleted
inserted
replaced
14072:2e4d79dcc0a0 | 14073:72c84f24b420 |
---|---|
285 else: | 285 else: |
286 repopath, bundlename = parentpath, path | 286 repopath, bundlename = parentpath, path |
287 return bundlerepository(ui, repopath, bundlename) | 287 return bundlerepository(ui, repopath, bundlename) |
288 | 288 |
289 def getremotechanges(ui, repo, other, revs=None, bundlename=None, | 289 def getremotechanges(ui, repo, other, revs=None, bundlename=None, |
290 force=False, usecommon=False): | 290 force=False): |
291 tmp = discovery.findcommonincoming(repo, other, heads=revs, force=force, | 291 tmp = discovery.findcommonincoming(repo, other, heads=revs, force=force) |
292 commononly=usecommon) | |
293 common, incoming, rheads = tmp | 292 common, incoming, rheads = tmp |
294 if not incoming: | 293 if not incoming: |
295 try: | 294 try: |
296 os.unlink(bundlename) | 295 os.unlink(bundlename) |
297 except OSError: | 296 except OSError: |
303 # create a bundle (uncompressed if other repo is not local) | 302 # create a bundle (uncompressed if other repo is not local) |
304 | 303 |
305 if revs is None and other.capable('changegroupsubset'): | 304 if revs is None and other.capable('changegroupsubset'): |
306 revs = rheads | 305 revs = rheads |
307 | 306 |
308 if usecommon: | 307 if other.capable('getbundle'): |
309 cg = other.getbundle('incoming', common=common, heads=revs) | 308 cg = other.getbundle('incoming', common=common, heads=revs) |
310 elif revs is None: | 309 elif revs is None: |
311 cg = other.changegroup(incoming, "incoming") | 310 cg = other.changegroup(incoming, "incoming") |
312 else: | 311 else: |
313 cg = other.changegroupsubset(incoming, revs, 'incoming') | 312 cg = other.changegroupsubset(incoming, revs, 'incoming') |