[cig-commits] commit: Merging the changes to the obtainRepository script made in branch v1.2.x back into the default branch
Mercurial
hg at geodynamics.org
Mon Nov 24 11:23:06 PST 2008
changeset: 85:2d0e6b4b91c5
parent: 82:64d894c49f62
parent: 84:1c784ffa5db0
user: jspencer at csd.vpac.org
date: Mon Nov 17 14:22:58 2008 +1100
description:
Merging the changes to the obtainRepository script made in branch v1.2.x back into the default branch
diff -r 64d894c49f62 -r 2d0e6b4b91c5 obtainRepositories.py
--- a/obtainRepositories.py Wed Oct 01 11:40:32 2008 +0200
+++ b/obtainRepositories.py Mon Nov 17 14:22:58 2008 +1100
@@ -4,6 +4,12 @@ import urllib2
import urllib2
import ConfigParser
import os, errno
+
+# hacky way to find out what the name of the branch is
+branch = os.popen('hg branch').readlines()
+branch = branch[0].replace("\n","")
+cwd = os.getcwd()
+
deps = [ \
['https://csd.vpac.org/hg/hgforest', '.hg/forest' ], \
@@ -27,6 +33,7 @@ except OSError, e:
# Download the dependancies...
u = ui.ui()
for dep in deps:
+ os.chdir(cwd)
try:
print dep[1], '...'
hg.clone( u, dep[0], dep[1] );
@@ -43,6 +50,15 @@ for dep in deps:
except urllib2.URLError, e:
print 'Download failed - ', e
+ # and heres some more hackyness to get hg to switch branches
+ # I couldn't find any functionality to do this in the python bindings.
+ # JS - 12/11/2008
+ os.chdir(dep[1])
+ try:
+ os.system("hg up "+branch)
+ except:
+ print "fail"
+
# Tell this root repository that its has forest
c=ConfigParser.ConfigParser()
c.read('.hg/hgrc')
More information about the CIG-COMMITS
mailing list