Added support for mercurial

This commit is contained in:
Ciaran Gultnieks 2011-01-03 10:55:18 +00:00
parent eeab77269b
commit a6b4830add
2 changed files with 12 additions and 2 deletions

2
README
View file

@ -68,7 +68,7 @@ The type of repository - for automatic building from source. If this is not
specified, automatic building is disabled for this application. Possible specified, automatic building is disabled for this application. Possible
values are: values are:
git, svn git, svn, hg
==Repo== ==Repo==

View file

@ -65,7 +65,7 @@ for app in apps:
# Get the source code... # Get the source code...
if app['repotype'] == 'git': if app['repotype'] == 'git':
if subprocess.call(['git', 'clone',app['repo'], build_dir]) != 0: if subprocess.call(['git', 'clone', app['repo'], build_dir]) != 0:
print "Git clone failed" print "Git clone failed"
sys.exit(1) sys.exit(1)
elif app['repotype'] == 'svn': elif app['repotype'] == 'svn':
@ -73,6 +73,10 @@ for app in apps:
if subprocess.call(['svn', 'checkout', app['repo'], build_dir]) != 0: if subprocess.call(['svn', 'checkout', app['repo'], build_dir]) != 0:
print "Svn checkout failed" print "Svn checkout failed"
sys.exit(1) sys.exit(1)
elif app['repotype'] == 'hg':
if subprocess.call(['hg', 'clone', app['repo'], build_dir]) !=0:
print "Hg clone failed"
sys.exit(1)
else: else:
print "Invalid repo type " + app['repotype'] + " in " + app['id'] print "Invalid repo type " + app['repotype'] + " in " + app['id']
sys.exit(1) sys.exit(1)
@ -105,6 +109,12 @@ for app in apps:
cwd=build_dir) != 0: cwd=build_dir) != 0:
print "Svn update failed" print "Svn update failed"
sys.exit(1) sys.exit(1)
elif app['repotype'] == 'hg':
if subprocess.call(['hg', 'checkout', thisbuild['commit']],
cwd=build_dir) != 0:
print "Hg checkout failed"
sys.exit(1)
else: else:
print "Invalid repo type " + app['repotype'] print "Invalid repo type " + app['repotype']
sys.exit(1) sys.exit(1)