Details
Details
- Reviewers
pulkit indygreg - Group Reviewers
hg-reviewers - Commits
- rHGa2fa51415ddc: webutil: some %d instead of %s love on ints
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
pulkit | |
indygreg |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
if lines: | if lines: | ||||
yield tmpl('diffblock', parity=next(parity), blockno=blockno, | yield tmpl('diffblock', parity=next(parity), blockno=blockno, | ||||
lines=prettyprintlines(lines, blockno)) | lines=prettyprintlines(lines, blockno)) | ||||
def compare(tmpl, context, leftlines, rightlines): | def compare(tmpl, context, leftlines, rightlines): | ||||
'''Generator function that provides side-by-side comparison data.''' | '''Generator function that provides side-by-side comparison data.''' | ||||
def compline(type, leftlineno, leftline, rightlineno, rightline): | def compline(type, leftlineno, leftline, rightlineno, rightline): | ||||
lineid = leftlineno and ("l%s" % leftlineno) or '' | lineid = leftlineno and ("l%d" % leftlineno) or '' | ||||
lineid += rightlineno and ("r%s" % rightlineno) or '' | lineid += rightlineno and ("r%d" % rightlineno) or '' | ||||
llno = '%d' % leftlineno if leftlineno else '' | |||||
rlno = '%d' % rightlineno if rightlineno else '' | |||||
return tmpl('comparisonline', | return tmpl('comparisonline', | ||||
type=type, | type=type, | ||||
lineid=lineid, | lineid=lineid, | ||||
leftlineno=leftlineno, | leftlineno=leftlineno, | ||||
leftlinenumber="% 6s" % (leftlineno or ''), | leftlinenumber="% 6s" % llno, | ||||
leftline=leftline or '', | leftline=leftline or '', | ||||
rightlineno=rightlineno, | rightlineno=rightlineno, | ||||
rightlinenumber="% 6s" % (rightlineno or ''), | rightlinenumber="% 6s" % rlno, | ||||
rightline=rightline or '') | rightline=rightline or '') | ||||
def getblock(opcodes): | def getblock(opcodes): | ||||
for type, llo, lhi, rlo, rhi in opcodes: | for type, llo, lhi, rlo, rhi in opcodes: | ||||
len1 = lhi - llo | len1 = lhi - llo | ||||
len2 = rhi - rlo | len2 = rhi - rlo | ||||
count = min(len1, len2) | count = min(len1, len2) | ||||
for i in xrange(count): | for i in xrange(count): |