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

Re: condense_targets and basepath functions

From: Ben Collins-Sussman <sussman_at_newton.ch.collab.net>
Date: 2001-02-08 17:50:17 CET

Thanks for doing this! I'll process this message later today when my
hands are free...

Kevin Pilch-Bisson <kevin@pilch-bisson.net> writes:

> --2fHTh5uZTiUOsy+g
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
>
> 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 *=20
> 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,=20
> 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=20
> file as a target.
>
> What do you all think?
>
> --=20
> >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Kevin Pilch-Bisson
> kevin@pilch-bisson.net
> http://www.pilch-bisson.net
> PGP Public Key At http://pgp.pilch-bisson.net
>
> --2fHTh5uZTiUOsy+g
> Content-Type: application/pgp-signature
> Content-Disposition: inline
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.4 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
>
> iD8DBQE6gstcgJlk/lQdbnARAviZAKCLt0vu8env9ghDbdTMFwFh3RQmswCggqji
> P394IFjVRLslK23+OExFKQc=
> =g0qJ
> -----END PGP SIGNATURE-----
>
> --2fHTh5uZTiUOsy+g--
Received on Sat Oct 21 14:36:21 2006

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.