# HG changeset patch # User Bernhard Herzog # Date 1231858882 0 # Node ID e3cda08d2619071852326861c3e500dfefb67c19 # Parent 7dbf0a3443bb59830aac8e63cb76e03caceb08fd 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. diff -r 7dbf0a3443bb -r e3cda08d2619 test/test_packager.py --- a/test/test_packager.py Tue Jan 13 14:31:59 2009 +0000 +++ b/test/test_packager.py Tue Jan 13 15:01:22 2009 +0000 @@ -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", diff -r 7dbf0a3443bb -r e3cda08d2619 treepkg/packager.py --- a/treepkg/packager.py Tue Jan 13 14:31:59 2009 +0000 +++ b/treepkg/packager.py Tue Jan 13 15:01:22 2009 +0000 @@ -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):