Author: David Schneider <david.schnei...@picle.org> Branch: Changeset: r861:098f9a97951d Date: 2013-09-08 19:58 +0200 http://bitbucket.org/pypy/buildbot/changeset/098f9a97951d/
Log: store the original revsion and eventually set the final_file_name in the parse_revision step diff --git a/bot2/pypybuildbot/builds.py b/bot2/pypybuildbot/builds.py --- a/bot2/pypybuildbot/builds.py +++ b/bot2/pypybuildbot/builds.py @@ -203,8 +203,9 @@ # ':' should not be part of filenames --- too many issues self.build.setProperty('got_revision', got_revision, 'got_revision') - self.build.setProperty('final_file_name', final_file_name, - 'got_revision') + if not self.build.hasProperty('final_file_name'): + self.build.setProperty('final_file_name', final_file_name, + 'got_revision') class ParseRevision(BuildStep): """Parse the revision property of the source stamp and extract the global @@ -226,12 +227,20 @@ def start(self): stamp = self.build.getSourceStamp() - revision = stamp.revision - if isinstance(revision, (unicode, str)) and ':' in revision: - parts = revision.split(':') - self.build.setProperty('revision', parts[1], 'parse_revision') - stamp.revision = parts[1] - self.finished(SUCCESS) + revision = stamp.revision if stamp.revision is not None else '' + # + if not isinstance(revision, (unicode, str)) or ":" not in revision: + self.finished(SKIPPED) + return + # + self.build.setProperty('original_revision', revision, 'parse_revision') + self.build.setProperty('final_file_name', + revision.replace(':', '-'), 'parse_revision') + # + parts = revision.split(':') + self.build.setProperty('revision', parts[1], 'parse_revision') + stamp.revision = parts[1] + self.finished(SUCCESS) def update_hg(platform, factory, repourl, workdir, use_branch, diff --git a/bot2/pypybuildbot/test/test_builds.py b/bot2/pypybuildbot/test/test_builds.py --- a/bot2/pypybuildbot/test/test_builds.py +++ b/bot2/pypybuildbot/test/test_builds.py @@ -192,6 +192,8 @@ self.rebuilt.build = FakeBuild({'revision':u'123:ea5ca8'}) self.rebuilt.start() assert self.rebuilt.build.getProperties()['revision'] == 'ea5ca8' + assert self.rebuilt.build.getProperties()['original_revision'] == '123:ea5ca8' + assert self.rebuilt.build.getProperties()['final_file_name'] == '123-ea5ca8' def test_no_revision(self): self.rebuilt.build = FakeBuild() _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit