[Treepkg-commits] r187 - trunk/treepkg
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Apr 24 20:21:01 CEST 2009
Author: bh
Date: 2009-04-24 20:21:01 +0200 (Fri, 24 Apr 2009)
New Revision: 187
Modified:
trunk/treepkg/packager.py
Log:
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
Modified: trunk/treepkg/packager.py
===================================================================
--- trunk/treepkg/packager.py 2009-04-24 18:04:40 UTC (rev 186)
+++ trunk/treepkg/packager.py 2009-04-24 18:21:01 UTC (rev 187)
@@ -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"""
More information about the Treepkg-commits
mailing list