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

Re: svn_client_get_wc_root() issues (Python)

From: Jean-François Doyon <jfdoyon_at_gmail.com>
Date: Sun, 24 Jun 2018 08:12:30 -0400

Ah yes, one should use canonical internal style paths, of course ... thank
you!

On Sun, Jun 24, 2018 at 2:44 AM Stefan Sperling <stsp_at_elego.de> wrote:

> On Sun, Jun 24, 2018 at 08:40:07AM +0200, Stefan Sperling wrote:
> > On Sat, Jun 23, 2018 at 10:08:31PM -0400, Jean-François Doyon wrote:
> > > Hi all,
> > >
> > > Apparently this function should return the local abs path to the root
> of
> > > the WC, given a path to a file/dir within said WC.
> > >
> > > It however seems to only work on the root itself, anything below
> raises an
> > > error.
> > >
> > > Note the first example below works ('content' the root of the WC), and
> the
> > > second, for a file within it ('index.html'), fails!
> > >
> > > Yes, the WC is clean and in good state, .svn is there, things are
> > > committed, TortoiseSVN shows the illustrated icons, etc.
> > >
> > > libsvn and bindings are directly from VisualSVN, on Windows obviously.
> > >
> > > Do I need to setup my context further? Or is this a bug? (Did not see
> > > anything in the issue tracker)
> >
> > Try this:
> >
> > >>> from svn import core, client
> > >>> path =
> core.svn_dirent_internal_style('D:\\Users\\JF\\Documents\\content')
> > >>> ctx = client.svn_client_create_context2(None)
> > >>> wcrootpath = client.svn_client_get_wc_root(path, ctx)
>
> Forgot to mention:
>
> If your script needs wcrootpath as a windows-style path,
> the internal style can be converted back like this:
>
> >>> wcrootpath = core.svn_dirent_local_style(wcrootpath)
>
Received on 2018-06-24 14:12:59 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.