mercurial/templatefuncs.py
changeset 43695 fa246ada356b
parent 43106 d783f945a701
child 44589 fc1fa3a07af6
--- a/mercurial/templatefuncs.py	Fri Nov 15 10:16:22 2019 -0800
+++ b/mercurial/templatefuncs.py	Fri Nov 15 10:16:27 2019 -0800
@@ -310,13 +310,11 @@
     text = evalstring(context, mapping, args[0])
     indent = evalstring(context, mapping, args[1])
 
+    firstline = indent
     if len(args) == 3:
         firstline = evalstring(context, mapping, args[2])
-    else:
-        firstline = indent
 
-    # the indent function doesn't indent the first line, so we do it here
-    return templatefilters.indent(firstline + text, indent)
+    return templatefilters.indent(text, indent, firstline=firstline)
 
 
 @templatefunc(b'get(dict, key)')