# HG changeset patch # User Thomas Arendsen Hein # Date 1180720149 -7200 # Node ID 08ae451148b24b72b046ddb2ff8cf9ed307b6bd6 # Parent f975e986b4bf54e12d9f579ed8a3404b435104d9# Parent 671158f060cc2a0ea485067c403305bde632bd22 merge with stable diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1593,7 +1593,14 @@ def incoming(ui, repo, source="default", other = hg.repository(ui, source) ui.status(_('comparing with %s\n') % source) - incoming = repo.findincoming(other, force=opts["force"]) + revs = None + if opts['rev']: + if 'lookup' in other.capabilities: + revs = [other.lookup(rev) for rev in opts['rev']] + else: + error = _("Other repository doesn't support revision lookup, so a rev cannot be specified.") + raise util.Abort(error) + incoming = repo.findincoming(other, heads=revs, force=opts["force"]) if not incoming: try: os.unlink(opts["bundle"]) @@ -1607,7 +1614,12 @@ def incoming(ui, repo, source="default", fname = opts["bundle"] if fname or not other.local(): # create a bundle (uncompressed if other repo is not local) - cg = other.changegroup(incoming, "incoming") + if revs is None: + cg = other.changegroup(incoming, "incoming") + else: + if 'changegroupsubset' not in other.capabilities: + raise util.Abort(_("Partial incoming cannot be done because other repository doesn't support changegroupsubset.")) + cg = other.changegroupsubset(incoming, revs, 'incoming') bundletype = other.local() and "HG10BZ" or "HG10UN" fname = cleanup = changegroup.writebundle(cg, fname, bundletype) # keep written bundle? @@ -1617,9 +1629,6 @@ def incoming(ui, repo, source="default", # use the created uncompressed bundlerepo other = bundlerepo.bundlerepository(ui, repo.root, fname) - revs = None - if opts['rev']: - revs = [other.lookup(rev) for rev in opts['rev']] o = other.changelog.nodesbetween(incoming, revs)[0] if opts['newest_first']: o.reverse() diff --git a/tests/test-incoming-outgoing.out b/tests/test-incoming-outgoing.out --- a/tests/test-incoming-outgoing.out +++ b/tests/test-incoming-outgoing.out @@ -73,6 +73,7 @@ date: Mon Jan 12 13:46:40 1970 +0 summary: 3 changeset: 4:1f3a964b6022 +tag: tip user: test date: Mon Jan 12 13:46:40 1970 +0000 summary: 4