##// END OF EJS Templates
templater: show the style list when I try to use a wrong one...
Iulian Stana -
r19125:6ba6e345 default
parent child Browse files
Show More
@@ -394,6 +394,16 b' class engine(object):'
394
394
395 engines = {'default': engine}
395 engines = {'default': engine}
396
396
397 def stylelist():
398 path = templatepath()[0]
399 dirlist = os.listdir(path)
400 stylelist = []
401 for file in dirlist:
402 split = file.split(".")
403 if split[0] == "map-cmdline":
404 stylelist.append(split[1])
405 return ", ".join(stylelist)
406
397 class templater(object):
407 class templater(object):
398
408
399 def __init__(self, mapfile, filters={}, defaults={}, cache={},
409 def __init__(self, mapfile, filters={}, defaults={}, cache={},
@@ -415,7 +425,8 b' class templater(object):'
415 if not mapfile:
425 if not mapfile:
416 return
426 return
417 if not os.path.exists(mapfile):
427 if not os.path.exists(mapfile):
418 raise util.Abort(_('style not found: %s') % mapfile)
428 raise util.Abort(_("style '%s' not found") % mapfile,
429 hint=_("available styles: %s") % stylelist())
419
430
420 conf = config.config()
431 conf = config.config()
421 conf.read(mapfile)
432 conf.read(mapfile)
@@ -84,6 +84,14 b' log on directory'
84 abort: cannot follow file not in parent revision: "dir"
84 abort: cannot follow file not in parent revision: "dir"
85 [255]
85 [255]
86
86
87 -f, a wrong style
88
89 $ hg log -f -l1 --style something
90 abort: style 'something' not found
91 (available styles: changelog, bisect, default, xml, compact)
92 [255]
93
94
87 -f, but no args
95 -f, but no args
88
96
89 $ hg log -f
97 $ hg log -f
General Comments 0
You need to be logged in to leave comments. Login now