[PATCH 1 of 4] templater: rewrite doc of _hybrid class as docstring

Yuya Nishihara yuya at tcha.org
Tue Apr 4 16:00:56 UTC 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1461492934 -32400
#      Sun Apr 24 19:15:34 2016 +0900
# Node ID 41891582b5c66541a40147e30e55153b6a0f2d79
# Parent  81abd0d12c8641df666d356f6033d84cd55977a8
templater: rewrite doc of _hybrid class as docstring

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -19,14 +19,17 @@ from . import (
     util,
 )
 
-# This helper class allows us to handle both:
-#  "{files}" (legacy command-line-specific list hack) and
-#  "{files % '{file}\n'}" (hgweb-style with inlining and function support)
-# and to access raw values:
-#  "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
-#  "{get(extras, key)}"
+class _hybrid(object):
+    """Wrapper for list or dict to support legacy template
 
-class _hybrid(object):
+    This class allows us to handle both:
+    - "{files}" (legacy command-line-specific list hack) and
+    - "{files % '{file}\n'}" (hgweb-style with inlining and function support)
+    and to access raw values:
+    - "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
+    - "{get(extras, key)}"
+    """
+
     def __init__(self, gen, values, makemap, joinfmt):
         self.gen = gen
         self.values = values


More information about the Mercurial-devel mailing list