I’m automating project creation with a python script. I can create repositories, checkout, commit, and import directories, all from within python.
What it won’t seem to do is set the svn:externals property. I can set this from command line but when I try to run the command with asubprocess.call it doesn’t work.
Here’s the command line (that works when in the checked-out project directory):
svn propset svn:externals "trunk/Source/Interactive/Flash.Externals https://server/svn/proj/" .
Here’s the script call (which runs after checking the repo out to gv.project_repo_dir):
# gv is a global variables object
odir = getcwd()
chdir(getcwd() + '/' + gv.project_repo_dir)
res = call(['svn', 'propset', 'svn:externals', \
'"'+ gv.interactive_subpath +'Flash.Externals '+ gv.mirror_project_repo_url +'"', \
'.'])
chdir(odir)
Here’s the error from the script run:
svn: Error parsing svn:externals property on '.': '"trunk/Source/Interactive/Flash.Externals https://server/svn/proj/"'
I’ve tried this with shell=True as an arg to the call and without; no dice.
Any ideas?
Stats:
- Python 2.7
- Windows Server 2003
- VisualSVN
I would recommend looking at the pysvn module vs. doing it through command line:
http://pysvn.tigris.org/
But if you have to do it through command line, can you use the os.system call instead of the subprocess?
should run “as shell”, you just aren’t able to get feedback from it – it will run the command and wait until the command is finished.
That, or you could try breaking the command up (not 100% sure if this works in Windows, but pretty sure):