mercurial/commands.py
changeset 20389 9a86b5b8e0d8
parent 20364 a6cf48b2880d
child 20404 466707047c8d
--- a/mercurial/commands.py	Sun Feb 10 00:11:45 2013 +0100
+++ b/mercurial/commands.py	Mon Jan 27 11:17:07 2014 +0100
@@ -2107,10 +2107,21 @@
     import templater
     p = templater.templatepath()
     ui.status(_("checking templates (%s)...\n") % ' '.join(p))
-    try:
-        templater.templater(templater.templatepath("map-cmdline.default"))
-    except Exception, inst:
-        ui.write(" %s\n" % inst)
+    if p:
+        m = templater.templatepath("map-cmdline.default")
+        if m:
+            # template found, check if it is working
+            try:
+                templater.templater(m)
+            except Exception, inst:
+                ui.write(" %s\n" % inst)
+                p = None
+        else:
+            ui.write(_(" template 'default' not found\n"))
+            p = None
+    else:
+        ui.write(_(" no template directories found\n"))
+    if not p:
         ui.write(_(" (templates seem to have been installed incorrectly)\n"))
         problems += 1