subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Sperling <s...@elego.de>
Subject Re: svn_client_get_wc_root() issues (Python)
Date Sun, 24 Jun 2018 06:44:08 GMT
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)

Mime
View raw message