[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Python SWIG bindings help

From: Rishabh Manocha <rmanocha_at_gmail.com>
Date: Thu, 27 Mar 2008 12:55:18 +0530

Hari,

Thanks a lot. That does just what I wanted it to do. I had also, in
the meantime figured out how to do something similar using pysvn -

import pysvn
path = svn+ssh://rmanocha@myhost/opt/svn/repos
client = pysvn.Client()
entries = client.ls(path)

I will look into both these methods in some more detail and see which
one I would rather use. Do you have any suggestions?? One problem I
did have with using pysvn was that I have to login using my password
everytime using the above code (even though I defined a login callback
function and assigned it as per the documentation on pysvn's site).

Also, is there any source of documentation/tutorials for the python
svn SWIG bindings (I don't mind reading c header files too if someone
can just show me how to :)).

Best,

R

On Thu, Mar 27, 2008 at 12:39 AM, Hari Kodungallur
<hkodungallur_at_gmail.com> wrote:
>
>
> On Wed, Mar 26, 2008 at 2:07 AM, Rishabh Manocha <rmanocha_at_gmail.com> wrote:
> > Any suggestions here - I'm still unable to wrap my head around this
> problem.
> >
> > R
> >
> >
> >
> >
> > On Tue, Mar 25, 2008 at 11:19 AM, Rishabh Manocha <rmanocha_at_gmail.com>
> wrote:
> > > Paul,
> > >
> > > I did take a look at pysvn and from what I gathered, it was more of a
> > > client side library. I want to work directly with the server/local
> > > repository (again, something like viewcv or trac) instead of having to
> > > checkout a version of the repository before being able to work with
> > > it. Am I getting pysvn wrong here??
> > >
> > > Thanks,
> > >
> > > R
> > >
> > >
> > >
> > > On Mon, Mar 24, 2008 at 9:56 PM, Paul Koning <Paul_Koning_at_dell.com>
> wrote:
> > > > >>>>> "Rishabh" == Rishabh Manocha <rmanocha_at_gmail.com> writes:
> > > >
> > > > Rishabh> Hello All, I'm not sure if this question has been answered
> > > > Rishabh> before (I could not find anything in the mailing list
> > > > Rishabh> archives) so please excuse me if it has.
> > > >
> > > > Rishabh> I was starting some work on my local SVN repository -
> trying
> > > > Rishabh> to access it via Python, similar to what ViewVC or Trac
> > > > Rishabh> do. ...
> >
>
>
> Here's a very very basic code that you can start with:
>
>
> from svn import fs, core, repos
>
> mypool = core.svn_pool_create(None)
> myrepo = repos.open("/opt/svn/repos")
> myfs = repos.fs(myrepo)
> myyoung = fs.youngest_rev(myfs, None)
> myroot = fs.revision_root(myfs, myyoung, None)
>
> def entries(path):
> listing = fs.dir_entries(myroot, path, mypool).values()
> return [ x.name for x in listing ]
>
> print entries("")
> print entries("trunk")
> # etc..
>
>
>
> Hope this helps.
>
> regards,
> -Hari
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-03-27 08:25:41 CET

This is an archived mail posted to the Subversion Users mailing list.