Show More
@@ -519,10 +519,7 b' def listfilediffs(files, node, max):' | |||||
519 | return templateutil.mappedgenerator(_listfilediffsgen, |
|
519 | return templateutil.mappedgenerator(_listfilediffsgen, | |
520 | args=(files, node, max)) |
|
520 | args=(files, node, max)) | |
521 |
|
521 | |||
522 | def diffs(web, ctx, basectx, files, style, linerange=None, |
|
522 | def _prettyprintdifflines(tmpl, lines, blockno, lineidprefix): | |
523 | lineidprefix=''): |
|
|||
524 |
|
||||
525 | def prettyprintlines(lines, blockno): |
|
|||
526 |
|
|
523 | for lineno, l in enumerate(lines, 1): | |
527 |
|
|
524 | difflineno = "%d.%d" % (blockno, lineno) | |
528 |
|
|
525 | if l.startswith('+'): | |
@@ -533,13 +530,15 b' def diffs(web, ctx, basectx, files, styl' | |||||
533 |
|
|
530 | ltype = "difflineat" | |
534 |
|
|
531 | else: | |
535 |
|
|
532 | ltype = "diffline" | |
536 |
|
|
533 | yield tmpl.generate(ltype, { | |
537 |
|
|
534 | 'line': l, | |
538 |
|
|
535 | 'lineno': lineno, | |
539 |
|
|
536 | 'lineid': lineidprefix + "l%s" % difflineno, | |
540 |
|
|
537 | 'linenumber': "% 8s" % difflineno, | |
541 |
|
|
538 | }) | |
542 |
|
539 | |||
|
540 | def diffs(web, ctx, basectx, files, style, linerange=None, | |||
|
541 | lineidprefix=''): | |||
543 | repo = web.repo |
|
542 | repo = web.repo | |
544 | if files: |
|
543 | if files: | |
545 | m = match.exact(repo.root, repo.getcwd(), files) |
|
544 | m = match.exact(repo.root, repo.getcwd(), files) | |
@@ -566,7 +565,8 b' def diffs(web, ctx, basectx, files, styl' | |||||
566 | yield web.tmpl.generate('diffblock', { |
|
565 | yield web.tmpl.generate('diffblock', { | |
567 | 'parity': next(parity), |
|
566 | 'parity': next(parity), | |
568 | 'blockno': blockno, |
|
567 | 'blockno': blockno, | |
569 |
'lines': prettyprintlines(lines, blockno |
|
568 | 'lines': _prettyprintdifflines(web.tmpl, lines, blockno, | |
|
569 | lineidprefix), | |||
570 | }) |
|
570 | }) | |
571 |
|
571 | |||
572 | def compare(tmpl, context, leftlines, rightlines): |
|
572 | def compare(tmpl, context, leftlines, rightlines): |
General Comments 0
You need to be logged in to leave comments.
Login now