mercurial/commands.py
changeset 4863 6dc0094c0827
parent 4860 f3802f9f1840
child 4868 192cd95c2ba8
--- a/mercurial/commands.py	Tue Jul 10 09:52:32 2007 -0700
+++ b/mercurial/commands.py	Tue Jul 10 10:06:24 2007 -0700
@@ -142,7 +142,10 @@
     The default is the basename of the archive, with suffixes removed.
     '''
 
-    node = repo.changectx(opts['rev']).node()
+    ctx = repo.changectx(opts['rev'])
+    if not ctx:
+        raise util.Abort(_('repository has no revisions'))
+    node = ctx.node()
     dest = cmdutil.make_filename(repo, dest, node)
     if os.path.realpath(dest) == repo.root:
         raise util.Abort(_('repository root cannot be destination'))