Mercurial > treepkg
changeset 232:e3cda08d2619
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.
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Tue, 13 Jan 2009 15:01:22 +0000 |
parents | 7dbf0a3443bb |
children | 757e5504f46a |
files | test/test_packager.py treepkg/packager.py |
diffstat | 2 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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",
--- 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):