summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiovanni Mascellani <mascellani@poisson.phc.unipi.it>2011-08-01 13:02:18 +0200
committerSean Finney <seanius@htpc-l.(none)>2011-09-17 13:28:46 +0200
commit4a7d41f58846d8a040c9c8f5b4aa2207be2097ce (patch)
tree753200c21b4115a3059d5f53d5ea4bf619664988
parent36d723df4e46a36acde3cac2b8fda7678eddba8e (diff)
downloadpatch-tracker-4a7d41f58846d8a040c9c8f5b4aa2207be2097ce.tar.gz
Fix small bug with filenames that contain commas.
When tokenizing the "diffstat -t" output, commas inside the filename shouldn't be considered. We achive it by splitting only on the first three commas.
-rw-r--r--patchtracker/Patch.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/patchtracker/Patch.py b/patchtracker/Patch.py
index 80ad8dc..6a97754 100644
--- a/patchtracker/Patch.py
+++ b/patchtracker/Patch.py
@@ -22,7 +22,7 @@ class Diffstat:
copyfileobj(patch_fh, popen.stdin)
popen.stdin.close()
popen.stdout.readline()
- self._stats = map(lambda x: map(lambda y: y.strip(), x.split(',')), popen.stdout.readlines())
+ self._stats = map(lambda x: map(lambda y: y.strip(), x.split(',', 3)), popen.stdout.readlines())
popen.wait()
def stats(self):
@@ -31,7 +31,7 @@ class Diffstat:
i.write(str(self.patch))
i.close()
o.readline()
- return [map(lambda x: x.strip(), l.split(",")) for l in o.readlines()]
+ return [map(lambda x: x.strip(), l.split(",", 3)) for l in o.readlines()]
else:
return self._stats