changeset 261:e574b03a2957

Move the code that creates the builder for a new revision to a separate method. This makes it easier to override the behavior when also looking for tags to build
author Bernhard Herzog <bh@intevation.de>
date Fri, 24 Apr 2009 18:21:01 +0000
parents 6aeae11ca7fe
children 81ba86662cbd
files treepkg/packager.py
diffstat 1 files changed, 13 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/packager.py	Fri Apr 24 18:04:40 2009 +0000
+++ b/treepkg/packager.py	Fri Apr 24 18:21:01 2009 +0000
@@ -438,6 +438,18 @@
         env["DEBEMAIL"] = self.deb_email
         return env
 
+    def packager_for_new_revision(self):
+        current_revision = (self.last_changed_revision(),
+                            self.rules_working_copy.last_changed_revision())
+        logging.info("New revision is %s", current_revision)
+        if current_revision not in self.get_revision_numbers():
+            logging.info("Revision %s has not been packaged yet",
+                         current_revision)
+            return self.revision_packager_cls(self, *current_revision)
+        else:
+            logging.info("Revision %s has already been packaged.",
+                         current_revision)
+
     def package_if_updated(self, revision=None, do_svn_update=True):
         """Returns a new packager if the working copy has not been packaged yet.
         If do_svn_update is true -- the default -- update the working
@@ -450,16 +462,7 @@
             # TODO: what should happen with the debian checkout, if a
             # revision for the source checkoute was given?
             self.rules_working_copy.update_or_checkout()
-        current_revision = (self.last_changed_revision(),
-                            self.rules_working_copy.last_changed_revision())
-        logging.info("New revision is %s", current_revision)
-        if current_revision not in self.get_revision_numbers():
-            logging.info("Revision %s has not been packaged yet",
-                         current_revision)
-            return self.revision_packager_cls(self, *current_revision)
-        else:
-            logging.info("Revision %s has already been packaged.",
-                         current_revision)
+        return self.packager_for_new_revision()
 
     def get_revisions(self):
         """Returns RevisionPackager objects for each packaged revision"""
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)