changeset 29829:407879b0893b

templater: rename "right" argument of pad() function Before, right=True meant right justify, which I think is left padding.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 22 Apr 2016 21:32:30 +0900
parents cc11079644fc
children 2cec6eaf3610
files mercurial/templater.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templater.py	Fri Apr 22 21:29:13 2016 +0900
+++ b/mercurial/templater.py	Fri Apr 22 21:32:30 2016 +0900
@@ -504,7 +504,7 @@
 
     return templatefilters.fill(text, width, initindent, hangindent)
 
-@templatefunc('pad(text, width[, fillchar=\' \'[, right=False]])')
+@templatefunc('pad(text, width[, fillchar=\' \'[, left=False]])')
 def pad(context, mapping, args):
     """Pad text with a
     fill character."""
@@ -518,14 +518,14 @@
 
     text = evalstring(context, mapping, args[0])
 
-    right = False
+    left = False
     fillchar = ' '
     if len(args) > 2:
         fillchar = evalstring(context, mapping, args[2])
     if len(args) > 3:
-        right = evalboolean(context, mapping, args[3])
+        left = evalboolean(context, mapping, args[3])
 
-    if right:
+    if left:
         return text.rjust(width, fillchar)
     else:
         return text.ljust(width, fillchar)