changeset 300:e82fb08781a2

Turn the SourcePackager class attribute changemsg_template into a per-track configuration option called changelog_msg_template. For now, the change is compatible with old SourcePackager subclasses that override changemsg_template.
author Bernhard Herzog <bh@intevation.de>
date Fri, 20 Nov 2009 21:35:12 +0000
parents c32dc72ba979
children 3fcebc5cf93c
files test/test_readconfig.py treepkg/packager.py treepkg/readconfig.py
diffstat 3 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/test/test_readconfig.py	Fri Nov 20 21:06:10 2009 +0000
+++ b/test/test_readconfig.py	Fri Nov 20 21:35:12 2009 +0000
@@ -42,6 +42,7 @@
 packager_class: readconfig_test.%(name)s
 handle_dependencies: True
 signing_key_id: abcd1234
+changelog_msg_template: Update to feature branch r%%(revision)d
 
 [pkg_extraargs]
 svn_url: svn://example.com/%(name)s/trunk
@@ -83,6 +84,7 @@
                           [
             dict(name="extraargs",
                  base_dir="/home/builder/mill/tracks/extraargs",
+                 changelog_msg_template="Update to revision %(revision)d",
                  deb_email="treepkg@example.com",
                  deb_fullname="TreePKG",
                  deb_build_options="parallel=2",
@@ -102,6 +104,8 @@
                                "tracks/extraargs/mytarball.tgz")),
             dict(name="simple",
                  base_dir="/home/builder/mill/tracks/simple",
+                 changelog_msg_template=("Update to feature branch"
+                                         " r%(revision)d"),
                  deb_email="treepkg@example.com",
                  deb_fullname="TreePKG",
                  deb_build_options="",
--- a/treepkg/packager.py	Fri Nov 20 21:06:10 2009 +0000
+++ b/treepkg/packager.py	Fri Nov 20 21:35:12 2009 +0000
@@ -32,10 +32,9 @@
 
 class SourcePackager(object):
 
-    # Derived classes may want to override this message
-    changemsg_template = "Update to revision %(revision)d"
-
     pkg_basename = property(lambda self: self.track.pkg_basename)
+    changemsg_template = property(lambda self:
+                                  self.track.changelog_msg_template)
     track = _fromparent("track")
     revision = _fromparent("revision")
     pkg_revision = _fromparent("pkg_revision")
@@ -345,11 +344,13 @@
                  deb_fullname, packager_class="treepkg.packager",
                  pkg_revision_template="treepkg%(pkg_revision)d",
                  handle_dependencies=False, signing_key_id="", do_build=True,
-                 rules_svn_url=None, deb_build_options="", pkg_basename=""):
+                 rules_svn_url=None, deb_build_options="", pkg_basename="",
+                 changelog_msg_template="Update to r%(revision)s"):
         self.name = name
         if not pkg_basename:
             pkg_basename = name
         self.pkg_basename = pkg_basename
+        self.changelog_msg_template = changelog_msg_template
         self.base_dir = base_dir
         self.builder = PBuilder(pbuilderrc, root_cmd,
                                 release_signing_keyid=signing_key_id)
--- a/treepkg/readconfig.py	Fri Nov 20 21:06:10 2009 +0000
+++ b/treepkg/readconfig.py	Fri Nov 20 21:35:12 2009 +0000
@@ -30,6 +30,7 @@
     "pkg_revision_template", ("pkg_basename", str, ""),
     ("handle_dependencies", convert_bool),
     ("signing_key_id", str, ""),
+    ("changelog_msg_template", str, "Update to revision %(revision)d"),
     ]
 
 treepkg_desc = [
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)