# HG changeset patch # User Bernhard Herzog # Date 1231859001 0 # Node ID 757e5504f46a19b6096215519016b370daf55c95 # Parent e3cda08d2619071852326861c3e500dfefb67c19 Extend bin/updatetreepkg.py to rename the revision directories if they still all end in -1 instead of using the rules revision as that second number in the directory names. diff -r e3cda08d2619 -r 757e5504f46a bin/updatetreepkg.py --- a/bin/updatetreepkg.py Tue Jan 13 15:01:22 2009 +0000 +++ b/bin/updatetreepkg.py Tue Jan 13 15:03:21 2009 +0000 @@ -1,5 +1,5 @@ #! /usr/bin/python2.4 -# Copyright (C) 2007, 2008 by Intevation GmbH +# Copyright (C) 2007, 2008, 2009 by Intevation GmbH # Authors: # Bernhard Herzog # @@ -13,6 +13,12 @@ - Rename the build log from build.log to log/build_log.txt - Rename the build log from build_log.txt to log/build_log.txt + + - Rename the directory name of the revision from -1 to -0 + + The second number is now the revision of the packaging rules if + they're managed by SVN and always 0 for manual management of the + rules. """ import os @@ -33,6 +39,15 @@ if not dry_run: os.rename(old_name, new_name) +def update_rules_revision_in_directory_names(track, dry_run): + revisions = track.get_revisions() + rules_revisions = set(revision.rules_revision for revision in revisions) + if rules_revisions == set([1]): + for revision in revisions: + rename_file(revision.base_dir, + revision.base_dir[:-2] + "-0", + dry_run) + def update_treepkg(config_file, dry_run): treepkg_opts, packager_opts = read_config(config_file) for opts in packager_opts: @@ -50,6 +65,11 @@ # still were in the base directory rename_file(os.path.join(revision.base_dir, "build_log.txt"), revision.build_log, dry_run) + # Revision directories used to end with "-1". Now that number + # is the revision of the packaging rules which default to 0 for + # the traditional manual rules management without a version + # control system. Rename those directories if necessary + update_rules_revision_in_directory_names(track, dry_run) def parse_commandline(): parser = create_parser()