[Bug 4140] New: Traceback occurs if no templates are available

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Tue Dec 31 02:26:39 UTC 2013


http://bz.selenic.com/show_bug.cgi?id=4140

          Priority: normal
            Bug ID: 4140
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: Traceback occurs if no templates are available
          Severity: bug
    Classification: Unclassified
                OS: Linux
          Reporter: edmund.rhudy at yodle.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 2.8.1
         Component: Mercurial
           Product: Mercurial

This is kind of 1.5 bugs. When running hg log --style xxx (where xxx is a valid
template name), where no templates at all are actually available, you get back
an ugly traceback like the following:

** unknown exception encountered, please report by visiting
** http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.6 (r266:84292, Sep 11 2012, 08:34:23) [GCC 4.4.6 20120305 (Red
Hat 4.4.6-4)]
** Mercurial Distributed SCM (version 2.8.1)
** Extensions loaded: 
Traceback (most recent call last):
  File "/usr/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 28, in
run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 69, in
dispatch
    ret = _runcatch(req)
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 133, in
_runcatch
    return _dispatch(req)
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 806, in
_dispatch
    cmdpats, cmdoptions)
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 585, in
runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 897, in
_runcommand
    return checkargs()
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 868, in
checkargs
    return cmdfunc()
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 803, in
<lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib64/python2.6/site-packages/mercurial/util.py", line 512, in
check
    return func(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/mercurial/commands.py", line 4072,
in log
    displayer = cmdutil.show_changeset(ui, repo, opts, True)
  File "/usr/lib64/python2.6/site-packages/mercurial/cmdutil.py", line 970, in
show_changeset
    t = changeset_templater(ui, repo, patch, opts, mapfile, buffered)
  File "/usr/lib64/python2.6/site-packages/mercurial/cmdutil.py", line 838, in
__init__
    cache=defaulttempl)
  File "/usr/lib64/python2.6/site-packages/mercurial/templater.py", line 484,
in __init__
    hint=_("available styles: %s") % stylelist())
  File "/usr/lib64/python2.6/site-packages/mercurial/templater.py", line 450,
in stylelist
    path = templatepath()[0]
IndexError: list index out of range

(Incidentally, the reason there are no templates is because apparently
bdist_rpm does not correctly generate the file manifest on this platform
[CentOS 6.3] and pull in the mercurial/templates directory.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.



More information about the Mercurial-devel mailing list