diff mercurial/commands.py @ 5061:a49f2a4d5ff7

archive: abort on empty repository. Fixes #624.
author Brendan Cully <brendan@kublai.com>
date Tue, 10 Jul 2007 10:06:24 -0700
parents 8d982aef0be1
children 3d35c8cb5eb4 0f594cc36aed
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Aug 02 12:29:10 2007 -0500
+++ b/mercurial/commands.py	Tue Jul 10 10:06:24 2007 -0700
@@ -133,7 +133,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'))