Mercurial > dwindows
comparison os2/svnrev.cmd @ 1173:38e925147a60
Revert to using a file as the source for SVN revision number.
author | mhessling@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 19 Sep 2011 09:52:45 +0000 |
parents | 5ff264b41985 |
children | 31a78c16c306 |
comparison
equal
deleted
inserted
replaced
1172:5ff264b41985 | 1173:38e925147a60 |
---|---|
1 /* REXX script to get the svn revision and display it. */ | 1 /* REXX script to get the svn revision and display it. */ |
2 Trace o | 2 Trace o |
3 fn = 'SVN.REV' | |
3 Address System 'svnversion . | rxqueue > nul:' | 4 Address System 'svnversion . | rxqueue > nul:' |
4 /* default version to 0, if svnversion doesn't exist or no .svn here */ | 5 /* default version to 0, if svnversion doesn't exist or no .svn here */ |
5 ver = 0 | 6 ver = 0 |
6 If rc = 0 Then | 7 If Queued() \= 0 Then |
7 Do | 8 Do |
8 /* Using PARSE PULL preserves case */ | 9 /* Using PARSE PULL preserves case */ |
9 /* If it is a double value get the first value only */ | 10 /* If it is a double value get the first value only */ |
10 Parse Pull sval ver ':' . | 11 Parse Pull sval ver ':' . |
11 If Strip( ver ) = '' Then ver = sval | 12 If Strip( ver ) = '' Then ver = sval |
12 If ver = 'exported' Then ver = 0 | 13 If ver = 'exported' Then ver = 0 |
13 If Datatype( Right( ver, 1 ) ) \= 'NUM' Then ver = Substr( ver, 1, Length( ver) - 1 ) | 14 If Datatype( Right( ver, 1 ) ) \= 'NUM' Then ver = Substr( ver, 1, Length( ver) - 1 ) |
14 End | 15 End |
15 Say ver | 16 Call Stream fn, 'C', 'OPEN' |
17 Call Lineout fn,'VERREV='ver | |
18 Call Stream fn, 'C', 'CLOSE' | |
16 Exit 0 | 19 Exit 0 |