[Treepkg-commits] r158 - in trunk: test treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jan 13 16:01:22 CET 2009


Author: bh
Date: 2009-01-13 16:01:22 +0100 (Tue, 13 Jan 2009)
New Revision: 158

Modified:
   trunk/test/test_packager.py
   trunk/treepkg/packager.py
Log:
When checking whether to build a new revision, also update the rules
working copy, use it's revision too when comparing the current revision
with the already built revisions and use it when building a new revision.
Update the tests for this.

Part of this change is that now, the default revision for the rules is 0
not 1 as previously.  To avoid extra builds, existing treepkg instances
will have to be updated so that the directories end in -0 not -1.  There
will be a tool to help with this.


Modified: trunk/test/test_packager.py
===================================================================
--- trunk/test/test_packager.py	2009-01-13 14:31:59 UTC (rev 157)
+++ trunk/test/test_packager.py	2009-01-13 15:01:22 UTC (rev 158)
@@ -130,7 +130,7 @@
         version = track.last_changed_revision()
 
         # Now check the source and binary package files
-        pkgdir = os.path.join(self.trackdir, "pkg", "%d-1" % version)
+        pkgdir = os.path.join(self.trackdir, "pkg", "%d-0" % version)
         self.assertEquals(sorted(os.listdir(os.path.join(pkgdir, "src"))),
                           [name % locals() for name in
                            ["testpkg_%(version)d-%(debrevision)s.diff.gz",

Modified: trunk/treepkg/packager.py
===================================================================
--- trunk/treepkg/packager.py	2009-01-13 14:31:59 UTC (rev 157)
+++ trunk/treepkg/packager.py	2009-01-13 15:01:22 UTC (rev 158)
@@ -438,14 +438,18 @@
             return None
         if do_svn_update:
             self.update_checkout(revision=revision)
-        current_revision = self.last_changed_revision()
-        logging.info("New revision is %d", current_revision)
+            # 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, 1) not in self.get_revision_numbers():
-            logging.info("Revision %d has not been packaged yet",
+            logging.info("Revision %s has not been packaged yet",
                          current_revision)
-            return self.revision_packager_cls(self, current_revision, 1)
+            return self.revision_packager_cls(self, *current_revision)
         else:
-            logging.info("Revision %d has already been packaged.",
+            logging.info("Revision %s has already been packaged.",
                          current_revision)
 
     def get_revisions(self):



More information about the Treepkg-commits mailing list