mercurial/commands.py
changeset 4853 6dc0094c0827
parent 4850 f3802f9f1840
child 4868 192cd95c2ba8
equal deleted inserted replaced
4852:cba10652a901 4853:6dc0094c0827
   140     Each member added to an archive file has a directory prefix
   140     Each member added to an archive file has a directory prefix
   141     prepended.  Use "-p" to specify a format string for the prefix.
   141     prepended.  Use "-p" to specify a format string for the prefix.
   142     The default is the basename of the archive, with suffixes removed.
   142     The default is the basename of the archive, with suffixes removed.
   143     '''
   143     '''
   144 
   144 
   145     node = repo.changectx(opts['rev']).node()
   145     ctx = repo.changectx(opts['rev'])
       
   146     if not ctx:
       
   147         raise util.Abort(_('repository has no revisions'))
       
   148     node = ctx.node()
   146     dest = cmdutil.make_filename(repo, dest, node)
   149     dest = cmdutil.make_filename(repo, dest, node)
   147     if os.path.realpath(dest) == repo.root:
   150     if os.path.realpath(dest) == repo.root:
   148         raise util.Abort(_('repository root cannot be destination'))
   151         raise util.Abort(_('repository root cannot be destination'))
   149     dummy, matchfn, dummy = cmdutil.matchpats(repo, [], opts)
   152     dummy, matchfn, dummy = cmdutil.matchpats(repo, [], opts)
   150     kind = opts.get('type') or 'files'
   153     kind = opts.get('type') or 'files'