13
0

bzr revision support (thomas v.)

git-svn-id: svn://localhost/ardour2/branches/3.0@5417 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-07-23 12:04:46 +00:00
parent 38510cb19e
commit c948806811

12
wscript
View File

@ -5,6 +5,7 @@ import os
import commands import commands
import re import re
import string import string
import subprocess
# Variables for 'waf dist' # Variables for 'waf dist'
VERSION = '3.0pre0' VERSION = '3.0pre0'
@ -53,12 +54,23 @@ def fetch_git_revision (path):
pass pass
return rev return rev
def fetch_bzr_revision (path):
cmd = subprocess.Popen("LANG= bzr log -l 1 " + path, stdout=subprocess.PIPE, shell=True)
out = cmd.communicate()[0]
svn = re.search('^svn revno: [0-9]*', out, re.MULTILINE)
str = svn.group(0)
chars = 'svnreio: '
return string.lstrip(str, chars)
def create_stored_revision(): def create_stored_revision():
rev = "" rev = ""
if os.path.exists('.svn'): if os.path.exists('.svn'):
rev = fetch_svn_revision('.'); rev = fetch_svn_revision('.');
elif os.path.exists('.git'): elif os.path.exists('.git'):
rev = fetch_git_revision('.'); rev = fetch_git_revision('.');
elif os.path.exists('.bzr'):
rev = fetch_bzr_revision('.');
print "Revision: " + rev;
elif os.path.exists('libs/ardour/svn_revision.cc'): elif os.path.exists('libs/ardour/svn_revision.cc'):
print "Using packaged svn revision" print "Using packaged svn revision"
return return