[issue624] hg archive fails on empty repo

Matt Mackall mercurial-bugs at selenic.com
Mon Jul 9 18:33:46 CDT 2007


New submission from Matt Mackall <mpm at selenic.com>:

From: Sanjoy Mahajan <sanjoy at mrao.cam.ac.uk>

I forgot to commit the initial set of files to a repo before I did 'hg
archive' and discovered that 'hg archive' does not like an empty repo.
I'm using the latest revision (f48290).  Simple example:

$ hg init
$ hg archive /tmp/2
** unknown exception encountered, details follow
** report bug details to http://www.selenic.com/mercurial/bts
** or mercurial at selenic.com
** Mercurial Distributed SCM (version f48290864625)
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 11, in <module>
    mercurial.commands.run()
  File "/usr/local/lib/python2.5/site-packages/mercurial/commands.py", line
3127, in run
    sys.exit(dispatch(sys.argv[1:], argv0=sys.argv[0]))
  File "/usr/local/lib/python2.5/site-packages/mercurial/commands.py", line
3124, in dispatch
    return cmdutil.runcatch(u, args, argv0=argv0)
  File "/usr/local/lib/python2.5/site-packages/mercurial/cmdutil.py", line 37,
in runcatch
    return dispatch(ui, args, argv0=argv0)
  File "/usr/local/lib/python2.5/site-packages/mercurial/cmdutil.py", line 378,
in dispatch
    ret = runcommand(ui, options, cmd, d)
  File "/usr/local/lib/python2.5/site-packages/mercurial/cmdutil.py", line 431,
in runcommand
    return checkargs()
  File "/usr/local/lib/python2.5/site-packages/mercurial/cmdutil.py", line 387,
in checkargs
    return cmdfunc()
  File "/usr/local/lib/python2.5/site-packages/mercurial/cmdutil.py", line 370,
in <lambda>
    d = lambda: func(ui, repo, *args, **cmdoptions)
  File "/usr/local/lib/python2.5/site-packages/mercurial/commands.py", line 147,
in archive
    matchfn, prefix)
  File "/usr/local/lib/python2.5/site-packages/mercurial/archival.py", line 206,
in archive
    'repo: %s\nnode: %s\n' % (hex(repo.changelog.node(0)), hex(node)))
  File "/usr/local/lib/python2.5/site-packages/mercurial/revlog.py", line 475,
in node
    return rev == nullrev and nullid or self.index[rev][-1]
IndexError: list index out of range

----------
messages: 3475
nosy: mpm, sanjoy
priority: bug
status: unread
title: hg archive fails on empty repo

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue624>
____________________________________________________



More information about the Mercurial-devel mailing list