--- 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)