[Treepkg-commits] r4 - trunk/treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri May 11 15:00:41 CEST 2007


Author: bh
Date: 2007-05-11 15:00:41 +0200 (Fri, 11 May 2007)
New Revision: 4

Modified:
   trunk/treepkg/packager.py
Log:
Add revision parameter to PackagerGroup.__init__ and some other methods
to make it possible to package a specific revision.


Modified: trunk/treepkg/packager.py
===================================================================
--- trunk/treepkg/packager.py	2007-05-11 12:58:28 UTC (rev 3)
+++ trunk/treepkg/packager.py	2007-05-11 13:00:41 UTC (rev 4)
@@ -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:



More information about the Treepkg-commits mailing list