You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jörg Beyer <be...@web.de> on 2001/12/08 10:50:59 UTC

python client for svn?

 Hi,

I am thinking about a svn python client. All I saw is the old mailing
list from april. Has anybody thought about a python extension that ypu could
do thinks like this:

--- python code ---

import svnclient

myclient = svnclient("http//svn.myrepository.org")
s = myclient.status("/path/to/some/file")
...
myclient.update("/path/to/another/file")
...
myclient.import("/path/to/something/comletly different")
--- python code ---

as you might have guessed, this is just to get the idea, not to fix an api.

has anybody done any work on this, or has there been a diskussion
whether this will work or not?
yours
Joerg
______________________________________________________________________________
Lotto online tippen! Egal zu welcher Zeit, egal von welchem Ort. 
Mit dem WEB.DE Lottoservice. http://tippen2.web.de/?x=5


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: python client for svn?

Posted by Greg Stein <gs...@lyra.org>.
On Mon, Dec 10, 2001 at 08:19:16PM -0000, Barry Scott wrote:
> 
> I like the XML output idea. Its easy to handle in Python.
> 
> I've seen swig create buggy and crashing extensions, mostly because
> calling API functions in the wrong order is not allowed. I hope
> this is not going to be a problem with swiging the svn
> client.

I'm going to try to avoid it. I've been using Python for nearly seven years
now. I'll twist it and pound it and make it call me "Daddy". And I'm not
even scared of revamping SWIG to produce proper binding code :-)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: python client for svn?

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
"Darryl VanDorp" <dv...@westlandfasteners.com> writes:
> I would expect that python "bindings" etc. are of relatively low
> priority at this time?

Well, we're planning to use them to write cvs2svn, so they're higher
priority than you might think.  On the other hand, no one's actively
working on that right now, unless Greg Stein has been doing some stuff
in his copious spare time. :-)

-Karl

> -----Original Message-----
> 
> 
> On Sat, Dec 08, 2001 at 12:26:22PM -0000, Barry Scott wrote:
> > I'm very interested in having Python and svn play together.
> >
> > I see a number of ways to do this:
> >
> > 1) An extension around the svn client library.
> 
> I've been working on this periodically with the SWIG stuff in the "bindings"
> directory. We'll have Python bindings for the entire API (client, WC, FS,
> RA, etc).
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: python client for svn?

Posted by Darryl VanDorp <dv...@westlandfasteners.com>.
I would expect that python
"bindings" etc. are of relatively low
priority at this time?

-Darryl


-----Original Message-----


On Sat, Dec 08, 2001 at 12:26:22PM -0000, Barry Scott wrote:
> I'm very interested in having Python and svn play together.
>
> I see a number of ways to do this:
>
> 1) An extension around the svn client library.

I've been working on this periodically with the SWIG stuff in the "bindings"
directory. We'll have Python bindings for the entire API (client, WC, FS,
RA, etc).


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: python client for svn?

Posted by Barry Scott <ba...@ntlworld.com>.
I like the XML output idea. Its easy to handle in Python.

I've seen swig create buggy and crashing extensions, mostly because
calling API functions in the wrong order is not allowed. I hope
this is not going to be a problem with swiging the svn
client.

		BArry




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: python client for svn?

Posted by Greg Stein <gs...@lyra.org>.
On Sat, Dec 08, 2001 at 12:26:22PM -0000, Barry Scott wrote:
> I'm very interested in having Python and svn play together.
> 
> I see a number of ways to do this:
> 
> 1) An extension around the svn client library.

I've been working on this periodically with the SWIG stuff in the "bindings"
directory. We'll have Python bindings for the entire API (client, WC, FS,
RA, etc).

> 2) run svn via a popen() and parse the result
> 3) run svn via a popen() but tell svn to output marshaled python objects
> 
> (1) avoids the parsing problem of (2) but will have to be updated each
> time the svn command changes. It has the advantage of being able to get
> at any and all features of the svn client library.

By using SWIG, the creation and maintenance of the bindings is automatic. As
we change the API, the bindings will automatically change. No manual
processes whatsoever.

Note that SWIG can also provide Perl, TCL, Guile, Ruby, and Java bindings.

In all cases, the SWIG bindings are simple covers over the functions in the
library they are wrapping. It is expected that we would then hand-craft
object-oriented covers over those.

> (2) requires only python code, but has the parsing problem.

Note that we are trying to design svn output to be machine parsable. This
approach is doable, if a bit inefficient in some cases.

>...
> > -----Original Message-----
> > From: J�rg Beyer [mailto:beyer_joerg@web.de]
> > Sent: 08 December 2001 10:51
> > To: svn-dev
> > Subject: python client for svn?
> >
> >
> >  Hi,
> >
> > I am thinking about a svn python client. All I saw is the old mailing
> > list from april. Has anybody thought about a python extension that ypu could
> > do thinks like this:
> >
> > --- python code ---
> >
> > import svnclient
> >
> > myclient = svnclient("http//svn.myrepository.org")
> > s = myclient.status("/path/to/some/file")
> > ...
> > myclient.update("/path/to/another/file")
> > ...
> > myclient.import("/path/to/something/comletly different")
> > --- python code ---
> >
> > as you might have guessed, this is just to get the idea, not to fix an api.
> >
> > has anybody done any work on this, or has there been a diskussion
> > whether this will work or not?

For the Python bindings, I'm expecting to organize the modules into a
package. For example:

  import svn.client

Inside the package, the SWIG wrappers are actually named "_client". The
"client" module contains the "nice" covers over the raw library
functionality provided in the _client module.

If you're familiar with SWIG, or want to learn, then please feel free to
help out and provide patches. The SWIG .i files are located in
subversion/bindings/, although I plan to move all those to a bindings/swig/
subdirectory next time I pick that stuff up (within the next month, so I can
work on the cvs2svn converter).

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: python client for svn?

Posted by Barry Pederson <ba...@yahoo.com>.
Barry Scott wrote:

 > I'm very interested in having Python and svn play together.
 >
 > I see a number of ways to do this:
 >
 > 1) An extension around the svn client library.
 > 2) run svn via a popen() and parse the result
 > 3) run svn via a popen() but tell svn to output marshaled python objects
 >
 > (1) avoids the parsing problem of (2) but will have to be updated each
 > time the svn command changes. It has the advantage of being able to get
 > at any and all features of the svn client library.
 >
 > (2) requires only python code, but has the parsing problem.
 >
 > (3) avoids the need to keep an extension in sync with the svn client 
library
 > and removes the parsing problem that (2) suffers from.
 >
 > 	BArry

#3 sounds kind of interesting, but I wouldn't tie it too closely to 
python objects.  Maybe some kind of XML output, perhaps XML-RPC 
marshalling, so it could be more easily used by other languages 
(although I'd be totally into Python myself).

	Barry (not BArry)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: python client for svn?

Posted by Barry Scott <ba...@ntlworld.com>.
I'm very interested in having Python and svn play together.

I see a number of ways to do this:

1) An extension around the svn client library.
2) run svn via a popen() and parse the result
3) run svn via a popen() but tell svn to output marshaled python objects

(1) avoids the parsing problem of (2) but will have to be updated each
time the svn command changes. It has the advantage of being able to get
at any and all features of the svn client library.

(2) requires only python code, but has the parsing problem.

(3) avoids the need to keep an extension in sync with the svn client library
and removes the parsing problem that (2) suffers from.

	BArry


> -----Original Message-----
> From: J�rg Beyer [mailto:beyer_joerg@web.de]
> Sent: 08 December 2001 10:51
> To: svn-dev
> Subject: python client for svn?
>
>
>  Hi,
>
> I am thinking about a svn python client. All I saw is the old mailing
> list from april. Has anybody thought about a python extension that ypu could
> do thinks like this:
>
> --- python code ---
>
> import svnclient
>
> myclient = svnclient("http//svn.myrepository.org")
> s = myclient.status("/path/to/some/file")
> ...
> myclient.update("/path/to/another/file")
> ...
> myclient.import("/path/to/something/comletly different")
> --- python code ---
>
> as you might have guessed, this is just to get the idea, not to fix an api.
>
> has anybody done any work on this, or has there been a diskussion
> whether this will work or not?
> yours
> Joerg
> ______________________________________________________________________________
> Lotto online tippen! Egal zu welcher Zeit, egal von welchem Ort.
> Mit dem WEB.DE Lottoservice. http://tippen2.web.de/?x=5
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org