[Bug 4151] New: hg debuginstall does not show missing template directory as a problem

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Thu Jan 23 10:41:50 CST 2014


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

          Priority: normal
            Bug ID: 4151
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: hg debuginstall does not show missing template
                    directory as a problem
          Severity: bug
    Classification: Unclassified
                OS: All
          Reporter: simohe at besonet.ch
          Hardware: PC
            Status: UNCONFIRMED
           Version: 2.9-rc
         Component: Mercurial
           Product: Mercurial

When there is no template directory hg debuginstall does not report this as a
problem. It only reports empty brackets 
  $ hg debuginstall
  *...some lines*
  checking templates ()...
  *...some lines*
  no problems detected

to reproduce, rename the mercurial/templates directory (to templates_), 
and run hg debuginstall


Cause
=====

Looks like this line in templater.py [1] does not raise an error:
    templater.templater(templater.templatepath("map-cmdline.default"))

This is because templatepath returns [] when not found, and templater([])
returns a valid empty templater instance.

Testing with run-tests.py
=========================

Not trivial, because the test should not rename the templates directory.
(Other tests running parallel could fail. And when the test can not finish 
properly, the wrong named directory remains.)
A test extension could monkey patch templater.templatepath. But not sure if
this is a good approach, because this requires to synchronize changes to
templater.templatepath to the patched version.
When a test is written, please also run `hg log --style compact` to test issue
4140 (which also requires a missing template directory).

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


More information about the Mercurial-devel mailing list