# HG changeset patch # User Dirkjan Ochtman # Date 1206097501 -3600 # Node ID d2713d90252426a1cc2404fc0b4fa4d6c1360d03 # Parent 4b0c9c6747074d06337edc5b1bcc70116d39ca07 give better error message on non-existent mapfile (issue813) diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -7,6 +7,7 @@ from i18n import _ import re, sys, os +from mercurial import util def parsestring(s, quoted=True): '''parse a string using simple c-like syntax. @@ -55,6 +56,9 @@ if not mapfile: return + if not os.path.exists(mapfile): + raise util.Abort(_('style not found: %s') % mapfile) + i = 0 for l in file(mapfile): l = l.strip() diff --git a/tests/test-command-template.out b/tests/test-command-template.out --- a/tests/test-command-template.out +++ b/tests/test-command-template.out @@ -83,7 +83,7 @@ # error if style not readable abort: Permission denied: ./q # error if no style -abort: No such file or directory: notexist +abort: style not found: notexist # error if style missing key abort: ./t: no key named 'changeset' # error if include fails