summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Callaghan <dcallagh@redhat.com>2011-05-04 13:32:00 +1000
committerDan Callaghan <dcallagh@redhat.com>2011-05-04 13:32:00 +1000
commitddccb493b2944ae97134450eff909341d8ec18c8 (patch)
tree66392d2c9d3a31a9abeee33d9539d108b1f57377
parent60661b03c4c36007c832c855f508a443c5a9df58 (diff)
-rw-r--r--rel-eng/lib/beakertito.py42
-rw-r--r--rel-eng/tito.props3
2 files changed, 44 insertions, 1 deletions
diff --git a/rel-eng/lib/beakertito.py b/rel-eng/lib/beakertito.py
new file mode 100644
index 0000000..937d910
--- /dev/null
+++ b/rel-eng/lib/beakertito.py
@@ -0,0 +1,42 @@
+import re
+from tito.common import run_command
+from tito.tagger import VersionTagger
+
+class BeakerVersionTagger(VersionTagger):
+ """
+ VersionTagger with changelog customised for Beaker's peculiar requirements.
+
+ Note that the customisations in this subclass will only take effect when
+ using tito >= 0.3.1.
+ """
+
+ def _generate_default_changelog(self, last_tag):
+ # Grab all the commits we are interested in
+ commits = run_command('git log --pretty=format:%%H --relative %s..HEAD -- .'
+ % last_tag)
+
+ changelog = []
+ for sha in reversed(commits.split('\n')):
+ subject = run_command('git show -s --pretty="format:%%s%s" %s'
+ % (self._changelog_email(), sha))
+
+ # Skip Gerrit merges
+ if re.match(r'Merge ".*" into develop', subject):
+ continue
+
+ # Skip Tito version bumps
+ if re.match(r'Automatic commit of package \[.*\] release \[.*\]', subject):
+ continue
+
+ # Tito's built-in cherry-pick cleaning
+ subject = self._changelog_remove_cherrypick(subject)
+
+ # Check for Bug: footer
+ body = run_command('git show -s --pretty=format:%%b %s' % sha)
+ m = re.search(r'^Bug:\s*(\d+)', body, re.IGNORECASE | re.MULTILINE)
+ if m:
+ bz_number = m.group(1)
+ subject = '%s %s' % (bz_number, subject)
+
+ changelog.append(subject)
+ return '\n'.join(changelog)
diff --git a/rel-eng/tito.props b/rel-eng/tito.props
index 7f27cf3..bd27bfa 100644
--- a/rel-eng/tito.props
+++ b/rel-eng/tito.props
@@ -1,3 +1,4 @@
[globalconfig]
default_builder = tito.builder.Builder
-default_tagger = tito.tagger.VersionTagger
+default_tagger = beakertito.BeakerVersionTagger
+lib_dir = rel-eng/lib