Sfoglia il codice sorgente

Workaround for unexpected content (line statistics).

Hopefully fixes a problem with linux-2.6 repository.
Heikki Hokkanen 18 anni fa
parent
commit
b79278897c
1 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. 5
    2
      gitstats

+ 5
- 2
gitstats Vedi File

@@ -268,8 +268,11 @@ class GitDataCollector(DataCollector):
268 268
 			# <stamp> <author>
269 269
 			if line.find('files changed,') == -1:
270 270
 				pos = line.find(' ')
271
-				(stamp, author) = (int(line[:pos]), line[pos+1:])
272
-				self.changes_by_date[stamp] = { 'files': files, 'ins': inserted, 'del': deleted, 'lines': total_lines }
271
+				if pos != -1:
272
+					(stamp, author) = (int(line[:pos]), line[pos+1:])
273
+					self.changes_by_date[stamp] = { 'files': files, 'ins': inserted, 'del': deleted, 'lines': total_lines }
274
+				else:
275
+					print 'Warning: unexpected line "%s"' % line
273 276
 			else:
274 277
 				numbers = re.findall('\d+', line)
275 278
 				if len(numbers) == 3: