Patchwork D2658: webutil: some %d instead of %s love on ints

login
register
mail settings
Submitter phabricator
Date March 4, 2018, 7:16 p.m.
Message ID <16ade0812ebb6c1433b79fc445d7d076@localhost.localdomain>
Download mbox | patch
Permalink /patch/28963/
State Not Applicable
Headers show

Comments

phabricator - March 4, 2018, 7:16 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa2fa51415ddc: webutil: some %d instead of %s love on ints (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2658?vs=6577&id=6586

REVISION DETAIL
  https://phab.mercurial-scm.org/D2658

AFFECTED FILES
  mercurial/hgweb/webutil.py

CHANGE DETAILS




To: durin42, #hg-reviewers, pulkit, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -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):