Mercurial > treepkg
changeset 80:0af2fa3790e0
Add revision parameter to PackagerGroup.__init__ and some other methods
to make it possible to package a specific revision.
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Fri, 11 May 2007 13:00:41 +0000 |
parents | 570ac81865be |
children | 2630a1c18816 |
files | treepkg/packager.py |
diffstat | 1 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/treepkg/packager.py Fri May 11 12:58:28 2007 +0000 +++ b/treepkg/packager.py Fri May 11 13:00:41 2007 +0000 @@ -311,16 +311,17 @@ "control")), "Source:") - def update_checkout(self): + def update_checkout(self, revision=None): """Updates the working copy of self.svn_url in self.checkout_dir. If self.checkout_dir doesn't exist yet, self.svn_url is checked - out into that directory. + out into that directory. The value of the revision parameter is + passed through to subversion.update. """ localdir = self.checkout_dir if os.path.exists(localdir): logging.info("Updating the working copy in %r", localdir) - subversion.update(localdir) + subversion.update(localdir, revision=revision) else: logging.info("The working copy in %r doesn't exist yet." " Checking out from %r", localdir, @@ -350,9 +351,9 @@ env["DEBEMAIL"] = self.deb_email return env - def package_if_updated(self): + def package_if_updated(self, revision=None): """Checks if the checkout changed and returns a new packager if so""" - self.update_checkout() + self.update_checkout(revision=revision) current_revision = self.last_changed_revision() logging.info("New revision is %d", current_revision) previous_revision = self.last_packaged_revision() @@ -376,9 +377,10 @@ class PackagerGroup(object): - def __init__(self, package_tracks, check_interval): + def __init__(self, package_tracks, check_interval, revision=None): self.package_tracks = package_tracks self.check_interval = check_interval + self.revision = revision def run(self): """Runs the packager group indefinitely""" @@ -404,7 +406,7 @@ logging.info("Checking package tracks") for track in self.package_tracks: try: - packager = track.package_if_updated() + packager = track.package_if_updated(revision=self.revision) if packager: packager.package() except: