templater: rename "right" argument of pad() function
authorYuya Nishihara <yuya@tcha.org>
Fri, 22 Apr 2016 21:32:30 +0900
changeset 29818 407879b0893b
parent 29817 cc11079644fc
child 29819 2cec6eaf3610
templater: rename "right" argument of pad() function Before, right=True meant right justify, which I think is left padding.
mercurial/templater.py
--- 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)