You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by John Peacock <jp...@rowman.com> on 2004/03/11 03:10:42 UTC
API compatiblility wrapper function dilemma
This is the old signature for one of the functions that needs to change for the
property keyword feature:
svn_error_t *
svn_subst_build_keywords (svn_subst_keywords_t *kw,
const char *keywords_string,
const char *rev,
const char *url,
apr_time_t date,
const char *author,
apr_pool_t *pool);
and this is the new signature:
svn_error_t *
svn_subst_build_keywords2 (svn_subst_keywords_t *kw,
const char *keywords_string,
const char *rev,
const char *url,
apr_time_t date,
const char *author,
apr_hash_t *props,
apr_pool_t *pool);
Does anyone see a way that I can get back to the props hash with only the url to
go on? I see svn_client_url_from_path(), but no svn_client_path_from_url and
the only way to get the props seems to be svn_wc_prop_list().
Hmmm...
John
p.s. this is another function which probably should have never been exposed
in the public API
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: API compatiblility wrapper function dilemma
Posted by John Peacock <jp...@rowman.com>.
Julian Foad wrote:
> No, but surely that's the whole point: the new version supports
> property-based keywords, but the old one doesn't. You can think of (and
> implement) the old function as passing NULL for the "props" argument.
So simple and yet so elegant. Thanks for the idea...
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5748
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: API compatiblility wrapper function dilemma
Posted by Julian Foad <ju...@btopenworld.com>.
John Peacock wrote:
> This is the old signature for one of the functions that needs to change
> for the property keyword feature:
>
> svn_error_t *
> svn_subst_build_keywords (svn_subst_keywords_t *kw,
[...]
>
> and this is the new signature:
>
> svn_error_t *
> svn_subst_build_keywords2 (svn_subst_keywords_t *kw,
[...]
>
> Does anyone see a way that I can get back to the props hash with only the url to go on?
No, but surely that's the whole point: the new version supports property-based keywords, but the old one doesn't. You can think of (and implement) the old function as passing NULL for the "props" argument.
> p.s. this is another function which probably should have never been exposed
> in the public API
If that's the case, perhaps you could investigate replacing it with something non-public, and deprecating the public interface.
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: API compatiblility wrapper function dilemma
Posted by John Peacock <jp...@rowman.com>.
kfogel@collab.net wrote:
>>Does anyone see a way that I can get back to the props hash with only
>>the url to go on?
>
> Not in a nice way, no.
That's what I was afraid of.
>
>
>>p.s. this is another function which probably should have never been exposed
>>in the public API
>
>
> Hmm, I don't know -- have you searched for its callers?
>
Yes. It's called from the following locations:
translate.c:svn_wc__get_keywords()
export.c:close_file() and copy_versioned_files()
cat.c:svn_client_cat()
commit.c: end_file_contents()
As you can see, the only existing public function which calls it is precisely
the best one to provide a public interface to it, i.e. cat.c:svn_client_cat().
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: API compatiblility wrapper function dilemma
Posted by kf...@collab.net.
John Peacock <jp...@rowman.com> writes:
> and this is the new signature:
>
> svn_error_t *
> svn_subst_build_keywords2 (svn_subst_keywords_t *kw,
> const char *keywords_string,
> const char *rev,
> const char *url,
> apr_time_t date,
> const char *author,
> apr_hash_t *props,
> apr_pool_t *pool);
>
>
> Does anyone see a way that I can get back to the props hash with only
> the url to go on? I see svn_client_url_from_path(), but no
> svn_client_path_from_url and the only way to get the props seems to be
> svn_wc_prop_list().
Not in a nice way, no.
> p.s. this is another function which probably should have never been exposed
> in the public API
Hmm, I don't know -- have you searched for its callers?
-K
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org