changeset 36734:a2fa51415ddc

webutil: some %d instead of %s love on ints Differential Revision: https://phab.mercurial-scm.org/D2658
author Augie Fackler <augie@google.com>
date Sun, 04 Mar 2018 12:21:01 -0500
parents f3591e687202
children e79adc12cde3
files mercurial/hgweb/webutil.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/webutil.py	Sun Mar 04 12:17:02 2018 -0500
+++ b/mercurial/hgweb/webutil.py	Sun Mar 04 12:21:01 2018 -0500
@@ -516,16 +516,18 @@
     '''Generator function that provides side-by-side comparison data.'''
 
     def compline(type, leftlineno, leftline, rightlineno, rightline):
-        lineid = leftlineno and ("l%s" % leftlineno) or ''
-        lineid += rightlineno and ("r%s" % rightlineno) or ''
+        lineid = leftlineno and ("l%d" % leftlineno) or ''
+        lineid += rightlineno and ("r%d" % rightlineno) or ''
+        llno = '%d' % leftlineno if leftlineno else ''
+        rlno = '%d' % rightlineno if rightlineno else ''
         return tmpl('comparisonline',
                     type=type,
                     lineid=lineid,
                     leftlineno=leftlineno,
-                    leftlinenumber="% 6s" % (leftlineno or ''),
+                    leftlinenumber="% 6s" % llno,
                     leftline=leftline or '',
                     rightlineno=rightlineno,
-                    rightlinenumber="% 6s" % (rightlineno or ''),
+                    rightlinenumber="% 6s" % rlno,
                     rightline=rightline or '')
 
     def getblock(opcodes):