# HG changeset patch # User Bernhard Herzog # Date 1240597261 0 # Node ID e574b03a295744d17c0c7e971bb8855627f9e455 # Parent 6aeae11ca7fe2f3975e9a2de6c8a470a520bbf36 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 diff -r 6aeae11ca7fe -r e574b03a2957 treepkg/packager.py --- 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"""