# HG changeset patch # User Oleg Oshmyan # Date 1291068901 0 # Node ID f90bd2d1a12b41054694f664eef60d54c334843b # Parent 3000bb94addb73a50c95c510767016077ed3edf9 Converted revision reporting from SVN to hg. diff -r 3000bb94addb -r f90bd2d1a12b 2.00/test-svn.py --- a/2.00/test-svn.py Mon Nov 29 01:24:22 2010 +0000 +++ b/2.00/test-svn.py Mon Nov 29 22:15:01 2010 +0000 @@ -10,8 +10,7 @@ from compat import * -# $Rev$ -version = '2.00.0 (SVN r$$REV$$)' +version = '2.00.0 ($$REV$$)' parser = optparse.OptionParser(version='test.py '+version, epilog='Python 2.5 or newer is required.') parser.add_option('-1', dest='legacy', action='store_true', default=False, help='handle configuration files in a way more compatible with test.py 1.x') parser.add_option('-u', '--update', dest='update', action='store_true', default=False, help='update the installed test.py to the latest publicly available version') diff -r 3000bb94addb -r f90bd2d1a12b publish.py --- a/publish.py Mon Nov 29 01:24:22 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -#! /usr/bin/python -# Copyright (c) 2009-2010 Chortos-2 - -with open('test-svn.py') as t: - f = t.read() -i = f.find('# $Rev: ') -j = f.find('\n', i) -rev = f[i+8:j-2] -f = f[0:i] + f[j+1:] -f = f.replace('$$REV$$', rev) -with open('test.py', 'wb') as t: - t.write(f) \ No newline at end of file diff -r 3000bb94addb -r f90bd2d1a12b publish.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/publish.sh Mon Nov 29 22:15:01 2010 +0000 @@ -0,0 +1,11 @@ +#! /bin/sh + +VERSION=`hg summary | grep '^parent' | sed -En 's/^parent: [0-9]*:([0-9a-f]+) .*$/\1/p'` +if [ -z "$VERSION" ] +then + echo The current Mercurial changeset could not be determined. >&2 + exit 1 +fi + +sed 's/$$REV$\$/hg '"$VERSION/" test-svn.py >test.py +chmod +x test.py \ No newline at end of file diff -r 3000bb94addb -r f90bd2d1a12b test-svn.py --- a/test-svn.py Mon Nov 29 01:24:22 2010 +0000 +++ b/test-svn.py Mon Nov 29 22:15:01 2010 +0000 @@ -3,8 +3,7 @@ import os, sys, shutil, time, subprocess, filecmp, optparse, signal, tempfile, tarfile, zipfile -# $Rev$ -version = '1.21.0 (SVN r$$REV$$)' +version = '1.21.0 ($$REV$$)' parser = optparse.OptionParser(version='test.py '+version, usage='usage: %prog [options] [problem names] [[path' + os.path.sep + 'to' + os.path.sep + ']solution-app] [test case numbers]\n\nTest case numbers can be specified in plain text or as a Python expression\nif there is only one positional argument.\n\nOnly problem names listed in testconf.py are recognized.') parser.add_option('-u', '--update', dest='update', action='store_true', default=False, help='check for an updated version of test.py') parser.add_option('-e', '--exclude', dest='exclude', action='append', help='test case number(s) to exclude, as a Python expression; multiple -e options can be supplied')