# HG changeset patch # User Peter Arrenbrecht # Date 1306175710 -7200 # Node ID 9ac479758d3b2c5b65175228659bf3cae1eafd48 # Parent 0c35514734e764e1b7e642143931e9b43c7c7be3 bundlerepo: make getremotechanges support filtering of incoming Extensions can hook discovery.findcommonincoming to filter out unwanted remote changesets. This patch makes getremotechanges respect the changed remote heads returned by such extensions. diff -r 0c35514734e7 -r 9ac479758d3b mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py Mon May 23 20:32:29 2011 +0200 +++ b/mercurial/bundlerepo.py Mon May 23 20:35:10 2011 +0200 @@ -326,15 +326,14 @@ if bundlename or not other.local(): # create a bundle (uncompressed if other repo is not local) - if onlyheads is None and other.capable('changegroupsubset'): - onlyheads = rheads - if other.capable('getbundle'): - cg = other.getbundle('incoming', common=common, heads=onlyheads) - elif onlyheads is None: + cg = other.getbundle('incoming', common=common, heads=rheads) + elif onlyheads is None and not other.capable('changegroupsubset'): + # compat with older servers when pulling all remote heads cg = other.changegroup(incoming, "incoming") + rheads = None else: - cg = other.changegroupsubset(incoming, onlyheads, 'incoming') + cg = other.changegroupsubset(incoming, rheads, 'incoming') bundletype = other.local() and "HG10BZ" or "HG10UN" fname = bundle = changegroup.writebundle(cg, bundlename, bundletype) # keep written bundle? @@ -346,7 +345,7 @@ # this repo contains local and other now, so filter out local again common = repo.heads() - csets = localrepo.changelog.findmissing(common, onlyheads) + csets = localrepo.changelog.findmissing(common, rheads) def cleanup(): if bundlerepo: