Changeset 6860


Ignore:
Timestamp:
Apr 21, 2009, 4:05:29 PM (11 years ago)
Author:
rwilson
Message:

Use svnversion for SVN revision number.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/utilities/system_tools.py

    r6859 r6860  
    126126        else:                   # assume Linux
    127127            try:
    128                 fid = os.popen('svn info 2>/dev/null')
     128                fid = os.popen('svnversion -n . 2>/dev/null')
    129129            except:
    130130                return get_revision_from_svn_entries()
     
    135135
    136136            # split revision number from data
    137             for line in version_info.split('\n'):
    138                 if line.startswith('Revision:'):
    139                     break
    140 
    141             fields = line.split(':')
    142             msg = 'Keyword "Revision" was not found anywhere in text: %s' % version_info
    143             assert fields[0].startswith('Revision'), msg
     137            if ':' in version_info:
     138                (_, revision_number) =  version_info.split(':')
     139            elif version_info.endswith('M'):
     140                revision_number = version_info[:-1]
     141            else:
     142                revision_number = version_info
    144143
    145144            try:
    146                 revision_number = int(fields[1])
     145                revision_number = int(revision_number)
    147146            except:
    148147                msg = ("Revision number must be an integer. I got '%s' from "
    149                        "'svn'." % fields[1])
     148                       "'svn'." % version_info)
    150149                raise Exception, msg
    151150
Note: See TracChangeset for help on using the changeset viewer.