comparison mercurial/patch.py @ 9639:5384a22ab698

diffstat: print 0 instead of nothing for 0 adds or removes This is in line with how the stock diffstat behaves when processing a single diff with no line modifications (like a binary diff).
author Brodie Rao <me+hg@dackz.net>
date Sun, 25 Oct 2009 02:35:35 +0200
parents a981ddb16b80
children 7d17794f08a9
comparison
equal deleted inserted replaced
9638:8f8f9685ac5e 9639:5384a22ab698
1405 return max(i * graphwidth // maxtotal, int(bool(i))) 1405 return max(i * graphwidth // maxtotal, int(bool(i)))
1406 1406
1407 for filename, adds, removes in stats: 1407 for filename, adds, removes in stats:
1408 pluses = '+' * scale(adds) 1408 pluses = '+' * scale(adds)
1409 minuses = '-' * scale(removes) 1409 minuses = '-' * scale(removes)
1410 output.append(' %-*s | %*.d %s%s\n' % (maxname, filename, countwidth, 1410 output.append(' %-*s | %*s %s%s\n' % (maxname, filename, countwidth,
1411 adds+removes, pluses, minuses)) 1411 adds+removes, pluses, minuses))
1412 1412
1413 if stats: 1413 if stats:
1414 output.append(_(' %d files changed, %d insertions(+), %d deletions(-)\n') 1414 output.append(_(' %d files changed, %d insertions(+), %d deletions(-)\n')
1415 % (len(stats), totaladds, totalremoves)) 1415 % (len(stats), totaladds, totalremoves))
1416 1416