Handle binary files in diffstat
Added/removed counts are "-". Change-Id: I339a91019f700106bae92b200aa554876065ea62
This commit is contained in:
parent
0a0ae71ea4
commit
989bccaa22
@ -173,8 +173,16 @@ class RevisionRow(urwid.WidgetWrap):
|
||||
total_added = 0
|
||||
total_removed = 0
|
||||
for added, removed, filename in stats:
|
||||
total_added += int(added)
|
||||
total_removed += int(removed)
|
||||
try:
|
||||
added = int(added)
|
||||
except ValueError:
|
||||
added = 0
|
||||
try:
|
||||
removed = int(removed)
|
||||
except ValueError:
|
||||
removed = 0
|
||||
total_added += added
|
||||
total_removed += removed
|
||||
rows.append(urwid.Columns([urwid.Text(filename),
|
||||
(10, urwid.Text('+%s, -%s' % (added, removed))),
|
||||
]))
|
||||
|
Loading…
x
Reference in New Issue
Block a user