List Info

Thread: Re: Pysvn & mod_python / serialisation




Re: Pysvn & mod_python / serialisation
user name
2008-04-12 04:00:51
On Apr 4, 2008, at 11:33, <Dominique.Holzwarthch.delarue.com>  
<Dominique.Holzwarthch.delarue.com> wrote:

> Hi everyone
>
> I intend to use pysvn together with the Apache server
and  
> mod_python module. Basicly I'm writting a web
application that  
> needs to access svn. My problem now is, that if the
script  
> "myscript.py" is called due to a browser
request I do something  
> like that:
>
> # create client object and do a checkout
> client = pysvn.Client(os.path.join(common.usersDir,
req.user,  
> common.userDirectories[3]))

You do know that this is the config folder for SVN not the
repo?
~/.subversion by default on unix. %APPDATA%Subversion on
windows I  
think.

> client.checkout(common.repositoryName, os.path.join 
> (common.usersDir, req.user,
common.userDirectories[1]))
>

I assume you also setup the username and password etc that
you need  
to get through authenication.


> Then, as an answer to another browser request, the
script "xy.py"  
> is called and inside it I'd like to do something like
this:
>
> # update the working directory before start working on
it
> client.update(...)
>
> My problem now is tho, that the client object is not
know anymore  
> of course... And if I do a
> client = pysvn.Client(os.path.join(common.usersDir,
req.user,  
> common.userDirectories[3]))
>
> I think that object doesn't know with which repository
it should  
> 'talk'...

True the object never knows, thats why you tell it in each
and every  
call with URL or PATH arguments.
All you need to do is pass the PATH to Client().update() and
 
everything will work.

>
> So I thought about pickling the client object (and
unpickle it in  
> every script when I need it) but I got an error:
>
>

I have no support for pickling a Client() object, its not
needed.

Barry



------------------------------------------------------------
---------
To unsubscribe, e-mail: users-unsubscribepysvn.tigris.org
For additional commands, e-mail: users-helppysvn.tigris.org


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )