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

Re: how can I get wc_root

From: Stefan Sperling <stsp_at_elego.de>
Date: Sun, 21 Jun 2009 13:51:26 +0100

On Sun, Jun 21, 2009 at 04:36:39PM +0800, HuiHuang wrote:
> hi Arfrever Frehtes Taifersar Arahesis,
>
> >$ grep uuid subversion/include/*
> Thanks for your help, it really works. I have found what I want.
>
> Now I have another question: Given a path, how can I get the wc_root?
> I find the following function in include/svn_wc.h.
>
> svn_error_t *
> svn_wc_is_wc_root(svn_boolean_t *wc_root,
> const char *path,
> svn_wc_adm_access_t *adm_access,
> apr_pool_t *pool);
> But it is not enough, is there any other function which can do the work?
> Or I have to write a new function by myself?
>
> Duplicate work is not necessary, so it is better to ask firstly:)

See bail_on_tree_conflicted_ancestor() in libsvn_client/commit_util.c.
That seems to do almost what you might need. It might be too strict,
however, because it looks for a top-most working copy root which is
not inside any other working copy. But you should allow commits from
multiple working copies even if the working copies are nested.

I'd suggest to look at *all* callers of svn_wc_is_wc_root().
If you cannot find any function that calls svn_wc_is_wc_root() and
does what you want, then you will probably have to implement a new
function, called for example svn_wc__find_wc_root().
You could use bail_on_tree_conflicted_ancestor() as an example of how
to walk upwards towards a working copy root. You could then send a patch
which adds just your new function.

Stefan
Received on 2009-06-21 14:51:56 CEST

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

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