Bug 4312 - Unknown exception while doing hg version
Summary: Unknown exception while doing hg version
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 3.1-rc
Hardware: PC Linux
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-23 12:08 UTC by JJLemire
Modified: 2014-08-01 13:50 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JJLemire 2014-07-23 12:08 UTC
hg version produces:
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 43, in <module>
    mercurial.dispatch.run()
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 28, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 69, in dispatch
    ret = _runcatch(req)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 138, in _runcatch
    return _dispatch(req)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 820, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 600, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 911, in _runcommand
    return checkargs()
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 882, in checkargs
    return cmdfunc()
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 817, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/util.py", line 550, in check
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/commands.py", line 6029, in version_
    maxnamelen = max(len(n) for n in names)
ValueError: max() arg is an empty sequence
Comment 1 Matt Mackall 2014-07-23 12:17 UTC
You have verbose enabled (with -v or ui.verbose) and version is now trying to list your extensions.
Comment 2 HG Bot 2014-07-23 12:30 UTC
Fixed by http://selenic.com/repo/hg/rev/54ff2789d75e
Matt Mackall <mpm@selenic.com>
version: don't traceback if no extensions to list (issue4312)

(please test the fix)
Comment 3 techtonik 2014-07-23 13:59 UTC
Thanks. I did't have HG with no extensions installed to test this.
Comment 4 techtonik 2014-07-23 13:59 UTC
I mean I didn't have a chance to think about testing this scenario.