Browse Source

Workaround for unexpected content (line statistics).

Hopefully fixes a problem with linux-2.6 repository.
Heikki Hokkanen 18 years ago
parent
commit
b79278897c
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      gitstats

+ 5
- 2
gitstats View File

268
 			# <stamp> <author>
268
 			# <stamp> <author>
269
 			if line.find('files changed,') == -1:
269
 			if line.find('files changed,') == -1:
270
 				pos = line.find(' ')
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
 			else:
276
 			else:
274
 				numbers = re.findall('\d+', line)
277
 				numbers = re.findall('\d+', line)
275
 				if len(numbers) == 3:
278
 				if len(numbers) == 3: