# HG changeset patch # User Benoit Boissinot # Date 1242841045 -7200 # Node ID b97e2417ae53f980569437f367adc82850dd29d4 # Parent 810387f59696e46c9980d9777301cce067d32ff6 fetch: allow -r for remote repos diff -r 810387f59696 -r b97e2417ae53 hgext/fetch.py --- a/hgext/fetch.py Wed May 20 18:35:47 2009 +0200 +++ b/hgext/fetch.py Wed May 20 19:37:25 2009 +0200 @@ -9,7 +9,7 @@ from mercurial.i18n import _ from mercurial.node import nullid, short -from mercurial import commands, cmdutil, hg, util, url +from mercurial import commands, cmdutil, hg, util, url, error from mercurial.lock import release def fetch(ui, repo, source='default', **opts): @@ -67,11 +67,12 @@ url.hidepassword(ui.expandpath(source))) revs = None if opts['rev']: - if not other.local(): - raise util.Abort(_("fetch -r doesn't work for remote " - "repositories yet")) - else: + try: revs = [other.lookup(rev) for rev in opts['rev']] + except error.CapabilityError: + err = _("Other repository doesn't support revision lookup, " + "so a rev cannot be specified.") + raise util.Abort(err) # Are there any changes at all? modheads = repo.pull(other, heads=revs)