source: anuga_core/source/anuga/get_version.py @ 4243

Last change on this file since 4243 was 1806, checked in by ole, 19 years ago

Added script to get latest version (for Win32 only)

File size: 1.1 KB
Line 
1"""Obtain the latest revision number and date from Subversion.
2
3Using the tool SubWCRev.exe on the download page on the SVN website or in the TortoiseSVN Folder under bin.
4
5To create run
6
7#SubWCRev.exe path\to\working\copy version.in version.h
8SubWCRev.exe . ver.txt ver.py
9
10FIXME: Works only under Win32
11
12Ex:
13version = 1798
14status = 'Modified'
15date = '2005/09/07 13:22:59'
16
17"""
18
19template = 'version.txt'
20version = 'version.py'
21
22#Write out template
23txt = """version = $WCREV$
24status = '$WCMODS?Modified:Not modified$'
25date = '$WCDATE$'
26"""
27
28fid = open(template, 'w')
29fid.write(txt)
30fid.close()
31
32#Run conversion
33import os
34cmd = 'SubWCRev.exe . %s %s' %(template, version)
35#print cmd
36err = os.system(cmd)
37if err != 0:
38    msg = 'Command %s could not execute.'
39    msg += 'Make sure the program SubWCRev.exe is available on your path'
40    raise msg
41
42
43
44#Obtain version
45cmd = 'from %s import version, status, date' %version[:-3]
46#print cmd
47exec(cmd)
48
49print 'Version: %d' %version
50print 'Date: %s' %date
51print 'Status: %s' %status
52
53
Note: See TracBrowser for help on using the repository browser.