Subversion commit from Python?
Diez B. Roggisch
deets at nospam.web.de
Tue May 19 10:51:33 EDT 2009
Jack Trades wrote:
> On May 19, 3:53 am, Lawrence D'Oliveiro <l... at geek-
> central.gen.new_zealand> wrote:
>> In message <ac63e27e-2dd9-4c27-ace0-
>> d9e205be7... at s31g2000vbp.googlegroups.com>, Jack Trades wrote:
>> > On May 19, 12:26 am, Lawrence D'Oliveiro <l... at geek-
>> > central.gen.new_zealand> wrote:
>> >> In message <2904e7de-0a8d-4697-9c44-
>> >> c83bb5319... at s31g2000vbp.googlegroups.com>, Jack Trades wrote:
>> >> > Originally I had the 'data' directory in the same directory as the
>> >> > cgi scripts and was using os.system("svn commit"), however I kept
>> >> > running into weird bugs with this method.
>> >> What bugs?
>> > I'm not 100% sure, but I think it had to do with executable
>> > permissions on the cgi scripts.
>> Possibly your CGI scripts are running as some user like "nobody", which
>> doesn't have the right access to the files/directories. Changing APIs
>> won't help here.
> Thanks for the help, I'll have to look into that further. If that is
> the case, would setuid be appropriate here? Or is there a better way
> to give the script the appropriate permissions?
> The only thing that baffles me is that the script works before a
> commit and only sometimes after a commit, if it were an access problem
> wouldn't it fail before the commit as well?
I have had many troubles with SVN + permissions.
My recipe is the following:
- create (or use) a "subversion"-group
- make all users (including e.g. www-data) that shall access the SVN
members of this group
- chown -R the svn-repository so that it belongs to this group
- chmod g+s -R to the svn-repository, so that the sticky group bit is set.
THis solves the problems for me usually.
More information about the Python-list