comparison 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 0f594cc36aed 3d35c8cb5eb4
comparison
equal deleted inserted replaced
5059:8d9bdcbb2b18 5061:a49f2a4d5ff7
131 Each member added to an archive file has a directory prefix 131 Each member added to an archive file has a directory prefix
132 prepended. Use "-p" to specify a format string for the prefix. 132 prepended. Use "-p" to specify a format string for the prefix.
133 The default is the basename of the archive, with suffixes removed. 133 The default is the basename of the archive, with suffixes removed.
134 ''' 134 '''
135 135
136 node = repo.changectx(opts['rev']).node() 136 ctx = repo.changectx(opts['rev'])
137 if not ctx:
138 raise util.Abort(_('repository has no revisions'))
139 node = ctx.node()
137 dest = cmdutil.make_filename(repo, dest, node) 140 dest = cmdutil.make_filename(repo, dest, node)
138 if os.path.realpath(dest) == repo.root: 141 if os.path.realpath(dest) == repo.root:
139 raise util.Abort(_('repository root cannot be destination')) 142 raise util.Abort(_('repository root cannot be destination'))
140 dummy, matchfn, dummy = cmdutil.matchpats(repo, [], opts) 143 dummy, matchfn, dummy = cmdutil.matchpats(repo, [], opts)
141 kind = opts.get('type') or 'files' 144 kind = opts.get('type') or 'files'