From d783379d12cf14d3a0d169ef78a230e15ebc072a Mon Sep 17 00:00:00 2001 From: Greg Noel Date: Mon, 7 Jun 2010 18:58:42 +0000 Subject: Fixed a bug in the regression test to use the right filenames for each platform; it was causing the test to fail on Windows. Added some documentation to bin/update-release-info.py. In my last log message, I forgot to mention that QMTest/TestRuntest.py was tweaked to make it less specialized for testing runtest.py. It can now be used to test other programs; in this case, bin/update-release-info.py. The defaults are unchanged so that it will normally test runtest.py. --- bin/update-release-info.py | 35 ++++++++++++++++++++++++++++++++++- test/update-release-info.py | 19 +++++++++---------- 2 files changed, 43 insertions(+), 11 deletions(-) diff --git a/bin/update-release-info.py b/bin/update-release-info.py index c65963a..4c174ba 100644 --- a/bin/update-release-info.py +++ b/bin/update-release-info.py @@ -1,6 +1,39 @@ #!/usr/bin/env python """ -Update files for release. FIXME: make the doc string actually document. +This program takes information about a release in the ReleaseConfig file +and inserts the information in various files. It helps to keep the files +in sync because it never forgets which files need to be updated, nor what +information should be inserted in each file. + +It takes one parameter that says what the mode of update should be, which +may be one of 'develop', 'release', or 'post'. + +In 'develop' mode, which is what someone would use as part of their own +development practices, the release type is forced to be 'alpha' and the +patch level is the string 'yyyymmdd'. Otherwise, it's the same as the +'release' mode. + +In 'release' mode, the release type is taken from ReleaseConfig and the +patch level is calculated from the release date for non-final runs and +taken from the version tuple for final runs. It then inserts information +in various files: + - The RELEASE header line in src/CHANGES.txt and src/Announce.txt. + - The version string at the top of src/RELEASE.txt. + - The version string in the 'default_version' variable in SConstruct + and QMTest/TestSCons.py. + - The copyright years in SConstruct and QMTest/TestSCons.py. + - The month and year (used for documentation) in SConstruct. + - The unsupported and deprecated Python floors in QMTest/TestSCons.py + and src/engine/SCons/Script/Main.py + - The version string in the filenames in README. + +In 'post' mode, files are prepared for the next release cycle: + - In ReleaseConfig, the version tuple is updated for the next release + by incrementing the release number (either minor or micro, depending + on the branch) and resetting release type to 'alpha'. + - A blank template replaces src/RELEASE.txt. + - A new section to accumulate changes is added to src/CHANGES.txt and + src/Announce.txt. """ # # __COPYRIGHT__ diff --git a/test/update-release-info.py b/test/update-release-info.py index 38371fd..4de60df 100644 --- a/test/update-release-info.py +++ b/test/update-release-info.py @@ -21,7 +21,8 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ -XXX Put a description of the test here. +Test bin/update-release-info.py. Also verify that the original files +have the appropriate triggers to cause the modifications. """ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -162,15 +163,13 @@ unsupported_python_version = Not done with junk deprecated_python_version = It goes on forever """) -combo_run(0, 7, stdout = -"""Updating src%(sep)sCHANGES.txt... -Updating src%(sep)sRELEASE.txt... -Updating src%(sep)sAnnounce.txt... -Updating SConstruct... -Updating README... -Updating QMTest%(sep)sTestSCons.py... -Updating src%(sep)sengine%(sep)sSCons%(sep)sScript%(sep)sMain.py... -""" % {'sep':os.sep}) +def updating_run(*args): + stdout = '' + for file in args: + stdout += 'Updating %s...\n' % os.path.join(*file) + combo_run(0, 7, stdout = stdout) + +updating_run(CHANGES, RELEASE, Announce, SConstruct, README, TestSCons, Main) test.must_match(CHANGES, """ RELEASE 2.0.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE -- cgit v0.12