Pārlūkot izejas kodu

Added try/except to catch weird lines from git-log --shortstat.

This is a workaround for linux-2.6 repository.
Heikki Hokkanen 18 gadus atpakaļ
vecāks
revīzija
9df3f8e6f2
1 mainītis faili ar 5 papildinājumiem un 2 dzēšanām
  1. 5
    2
      gitstats

+ 5
- 2
gitstats Parādīt failu

@@ -277,8 +277,11 @@ class GitDataCollector(DataCollector):
277 277
 			if line.find('files changed,') == -1:
278 278
 				pos = line.find(' ')
279 279
 				if pos != -1:
280
-					(stamp, author) = (int(line[:pos]), line[pos+1:])
281
-					self.changes_by_date[stamp] = { 'files': files, 'ins': inserted, 'del': deleted, 'lines': total_lines }
280
+					try:
281
+						(stamp, author) = (int(line[:pos]), line[pos+1:])
282
+						self.changes_by_date[stamp] = { 'files': files, 'ins': inserted, 'del': deleted, 'lines': total_lines }
283
+					except ValueError:
284
+						print 'Warning: unexpected line "%s"' % line
282 285
 				else:
283 286
 					print 'Warning: unexpected line "%s"' % line
284 287
 			else: