summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Barisione <marco@barisione.org>2010-02-10 16:53:28 (GMT)
committerMarco Barisione <marco@barisione.org>2010-02-10 16:53:28 (GMT)
commit82ff24f037edec70c22e040ee382f482cb2eb3b0 (patch)
tree147cc8f1a0d2014e339962edf067f4848ece0541
parentada855c2f7079725e24d5db3f3daef14d558f8a2 (diff)
downloadmaemo-release-82ff24f037edec70c22e040ee382f482cb2eb3b0.tar.gz
maemo-release-82ff24f037edec70c22e040ee382f482cb2eb3b0.tar.xz
Allow to add entries in the changelog with references to bugs
-rwxr-xr-xmaemo-release.py37
1 files changed, 26 insertions, 11 deletions
diff --git a/maemo-release.py b/maemo-release.py
index fdf9ae2..3f0e0cb 100755
--- a/maemo-release.py
+++ b/maemo-release.py
@@ -25,23 +25,38 @@ def find_latest_release_index(log, debian_log):
return i
+def get_nb_fix(entry):
+ start = entry.message.find('Fixes: NB#')
+ if start == -1:
+ return None
+
+ end = entry.message[start:].find('Reviewed')
+ if end != -1:
+ nb_fix = entry.message[start:start+end]
+ else:
+ nb_fix = entry.message[start:]
+
+ return nb_fix
+
+def get_nb_reference(entry):
+ mo = re.search('^See NB#(\d+)', entry.message,
+ re.IGNORECASE | re.MULTILINE)
+ if mo is None:
+ return None
+
+ return entry.summary.strip() + ' (see NB#%s)' % mo.group(1)
+
def filter_nb_info(log):
release_log = []
for entry in log:
- start = entry.message.find('Fixes: NB#')
- if start == -1:
+ nb_fix = get_nb_fix(entry)
+ if not nb_fix:
+ nb_fix = get_nb_reference(entry)
+ if not nb_fix:
continue
- end = entry.message[start:].find('Reviewed')
- if end != -1:
- end += start
- entry.nb_fix = entry.message[start:end]
- else:
- entry.nb_fix = entry.message[start:]
-
- entry.nb_fix = entry.nb_fix.replace('\n', ' ')
-
+ entry.nb_fix = nb_fix.replace('\n', ' ')
release_log.append(entry)
return release_log