Show More
@@ -469,26 +469,27 b' def annotate(ui, repo, *pats, **opts):' | |||
|
469 | 469 | |
|
470 | 470 | lines = fctx.annotate(follow=follow, linenumber=linenumber, |
|
471 | 471 | diffopts=diffopts) |
|
472 | if not lines: | |
|
473 | continue | |
|
472 | 474 | formats = [] |
|
473 | 475 | pieces = [] |
|
474 | 476 | |
|
475 | 477 | for f, sep in funcmap: |
|
476 | 478 | l = [f(n) for n, dummy in lines] |
|
477 |
if |
|
|
478 | if fm: | |
|
479 | formats.append(['%s' for x in l]) | |
|
480 | else: | |
|
481 | sizes = [encoding.colwidth(x) for x in l] | |
|
482 | ml = max(sizes) | |
|
483 | formats.append([sep + ' ' * (ml - w) + '%s' for w in sizes]) | |
|
484 | pieces.append(l) | |
|
479 | if fm: | |
|
480 | formats.append(['%s' for x in l]) | |
|
481 | else: | |
|
482 | sizes = [encoding.colwidth(x) for x in l] | |
|
483 | ml = max(sizes) | |
|
484 | formats.append([sep + ' ' * (ml - w) + '%s' for w in sizes]) | |
|
485 | pieces.append(l) | |
|
485 | 486 | |
|
486 | 487 | for f, p, l in zip(zip(*formats), zip(*pieces), lines): |
|
487 | 488 | fm.startitem() |
|
488 | 489 | fm.write(fields, "".join(f), *p) |
|
489 | 490 | fm.write('line', ": %s", l[1]) |
|
490 | 491 | |
|
491 |
if |
|
|
492 | if not lines[-1][1].endswith('\n'): | |
|
492 | 493 | fm.plain('\n') |
|
493 | 494 | |
|
494 | 495 | fm.end() |
General Comments 0
You need to be logged in to leave comments.
Login now