Subversion commit from Python?

Jack Trades JackTradesPublic at gmail.com
Tue May 19 01:48:30 EDT 2009


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.  I would click on a link in the main
document (named 'add section') and it worked as expected.  After
inserting the information for 'add section' and submitting it (info
was saved in the data folder, then a commit was done on the whole
project), clicking on the same 'add section' link would produce an
error (going back to the 'add section' script asked me to download it
instead of displaying it).

I'm using a very simple server to develop this on my computer...

import BaseHTTPServer
import CGIHTTPServer
import cgitb; cgitb.enable()  ## This line enables CGI error reporting

server = BaseHTTPServer.HTTPServer
handler = CGIHTTPServer.CGIHTTPRequestHandler
server_address = ("", 8000)
handler.cgi_directories = [""]

httpd = server(server_address, handler)
httpd.serve_forever()

I got no information about the error at all, and after some time
completely gave up on it.  I'm only guessing that it was a permissions
problem.  I have made a huge number of modifications to the program
since then (about 2 days ago), and am unable to investigate it
further.  I was just wondering if using os.system('svn commit') was
the right approach, or if there was a "more Pythonic" way of doing
this.



More information about the Python-list mailing list