changeset 12402:b014f998959d

templater: add a few comments.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Tue, 21 Sep 2010 23:55:32 +0200
parents 4cdaf1adafc8
children ba8850911703
files mercurial/templater.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templater.py	Fri Sep 24 12:46:54 2010 -0500
+++ b/mercurial/templater.py	Tue Sep 21 23:55:32 2010 +0200
@@ -138,10 +138,12 @@
             pos = n + 1
 
             if '%' in expr:
+                # the keyword should be formatted with a template
                 key, t = expr.split('%')
                 parsed.append((self._format, (key.strip(),
                                               self._load(t.strip()))))
             elif '|' in expr:
+                # process the keyword value with one or more filters
                 parts = expr.split('|')
                 val = parts[0].strip()
                 try:
@@ -150,6 +152,7 @@
                     raise SyntaxError(_("unknown filter '%s'") % i[0])
                 parsed.append((self._filter, (filters, val)))
             else:
+                # just get the keyword
                 parsed.append((self._get, expr.strip()))
 
         return parsed