summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2008-09-19 02:35:57 +0200
committerGuillaume Seguin <guillaume@segu.in>2008-09-19 02:35:57 +0200
commite7248aa612cfcc347c55922fc5ce576608248518 (patch)
tree49b3715675c52020a510575fb7f991bb6b60393d
parent226a2ecb0a9b9384841fda6e307d1251b3b9dfa3 (diff)
downloadfusion-releasekit-e7248aa612cfcc347c55922fc5ce576608248518.tar.gz
fusion-releasekit-e7248aa612cfcc347c55922fc5ce576608248518.tar.bz2
* Add total diffstat computationsHEADmaster
-rwxr-xr-xrelease.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/release.py b/release.py
index 5efdec3..c33c684 100755
--- a/release.py
+++ b/release.py
@@ -5,6 +5,7 @@ import os
import glob
import subprocess
import datetime
+import re
import config
@@ -15,6 +16,8 @@ TESTS_PREFIX = os.path.join (TESTS_PATH, "root")
ALL_MODE = False
NOES = ("n", "no")
+diffstat_regex = re.compile ("([0-9]+) files changed, ([0-9]+) insertions\(\+\), ([0-9]+) deletions\(-\)")
+
class Log (dict):
i = 0
@@ -545,7 +548,9 @@ def diffstat (component):
raise RuntimeError, "diffstat failed"
os.chdir (CURDIR)
- return "%s :%s" % (name, diffstat.split ("\n")[-2])
+ diffstat = diffstat.split ("\n")[-2].strip ()
+
+ return "%s : %s" % (name, diffstat)
def changelog (component):
name = component.split ("/")[-1]
@@ -606,7 +611,18 @@ components without any more confirmations")
elif "--diffstat" in sys.argv:
print info ("Building diffstat")
fix_env ()
+ diffstats = [diffstat (module) for module in config.modules]
print "\n".join (map (diffstat, config.modules))
+ files_changed = 0
+ insertions = 0
+ deletions = 0
+ for diff_stat in diffstats:
+ match = diffstat_regex.findall (diff_stat)[0]
+ files_changed += int (match[0])
+ insertions += int (match[1])
+ deletions += int (match[2])
+ print "Total : %d files changed, %d insertions(+), %d deletions(-)" \
+ % (files_changed, insertions, deletions)
elif "--changelog" in sys.argv:
print info ("Building changelog")
fix_env ()