Hi All,
I have completed implementations of the two functions for condensing a
list of targets, and finding the basepath of the targets, but I have a
number of questions about exact semantics that I thought I would ask
you all. If you've no time to think about for now, fine, just don't
respond until you do. If you do, great.
Here are the prototypes I have come up with so far:
svn_error_t *
svn_?_condense_targets(svn_string_t ***pcondensed_targets,
int *pnum_condensed_targets,
const svn_string_t **targets,
int num_targets,
apr_pool_t *pool);
svn_error_t *
svn_?_get_basepath(svn_string_t **pbasepath,
const svn_string_t **targets,
int num_targets,
apr_pool_t *pool);
Now for questions and notes:
1) What library should they be part of?
2) They currently return svn_error_t *, but nothing they call generates
an error, so they could just as well return results directly.
3) In condense_targets, I can calculate the basepath as a side-effect,
although it would be (slightly) less efficient than doing it after,
depending on the order of targets.
4) I have been creating a subpool of pool for temporary allocation, and
apr_pool_destroy()'ing it at the end of the functions, is this
appropriate?
5) I could also modify the targets array and num targets directly. Thus
combining points 2, 3, and 5, I could have a single prototype of the
form:
svn_string_t *
svn_?_condense_and_get_basepath(svn_string_t **targets,
int *num_targets,
apr_pool_t * pool);
with the return value being the basepath.
which I think is a better interface.
Problems with the algo's:
1) Won't work if some paths are given relatively and some absolutely.
2) No garantee that basepath is in a working copy
3) No garantee that basepath is a directory if given only a single
file as a target.
What do you all think?
--
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson
kevin@pilch-bisson.net
http://www.pilch-bisson.net
PGP Public Key At http://pgp.pilch-bisson.net
- application/pgp-signature attachment: stored
Received on Sat Oct 21 14:36:21 2006