[PATCH 2 of 5] templater: add a few comments

Dan Villiom Podlaski Christiansen danchr at gmail.com
Tue Sep 21 17:15:16 CDT 2010


# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
# Date 1285106132 -7200
# Node ID ad0bf1c540e338d1638f3c2a7c17d642acdb161b
# Parent  de684652dd8a18e71e04739889f86aa5b5cc35bd
templater: add a few comments.

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -138,10 +138,12 @@ class engine(object):
             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 @@ class engine(object):
                     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


More information about the Mercurial-devel mailing list