There is also a more convenient (for some) svnversion command.
The output may be a single revision number or something like this (from -h):
4123:4168 mixed revision working copy 4168M modified working copy 4123S switched working copy 4123:4168MS mixed revision, modified, switched working copy
I am using this python code snippet to retrieve revision information:
import re import subprocess p = subprocess.Popen(["svnversion"], stdout = subprocess.PIPE, stderr = subprocess.PIPE) p.wait() m = re.match(r'(|\d+M?S?):?(\d+)(M?)S?', p.stdout.read()) rev = int(m.group(2)) if m.group(3) == 'M': rev += 1
Saulius ลฝemaitaitis Jan 02 '09 at 13:02 2010-01-02 13:02
source share