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

Re: svn commit: rev 860 - trunk/subversion/libsvn_wc

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-01-12 10:41:29 CET

On Fri, Jan 11, 2002 at 06:19:53PM -0600, kfogel@tigris.org wrote:
>...
> +++ NEW/trunk/subversion/libsvn_wc/util.c Fri Jan 11 18:19:42 2002
>...
> + char *revision, *author, *date, *url;

note this

> SVN_ERR (svn_wc__get_eol_style (&style, &eol, vfile->data, pool));
> + SVN_ERR (svn_wc__get_keywords (&revision, &author, &date, &url,

and here

> + vfile->data, NULL, pool));
>...
> + SVN_ERR (svn_io_copy_and_translate (vfile->data,
> + tmp_vfile->data,
> + eol,
> + TRUE,
> + revision, author, date, url,

here

> + FALSE,
> + pool));
> + }
> + else if (style == svn_wc__eol_style_native)
> + {
> + SVN_ERR (svn_io_copy_and_translate (vfile->data,
> + tmp_vfile->data,
> + SVN_WC__DEFAULT_EOL_MARKER,
> + FALSE,
> + revision, author, date, url,

and here

The existing code for keywords does not scale well at all. If we add a
single keyword, then we have to go and touch dozens of function calls,
declarations, etc.

I would *highly* recommend something like:

typedef struct {
    const char *revision;
    const char *author;
    const char *date;
    const char *url;
    /* future keywords go here */
} svn_keyword_set_t;

svn_error_t * svn_wc__get_keywords(svn_keyword_set_t **kset, ...);

svn_error_t * svn_io_copy_and_translate(...,
                                        const svn_keyword_set_t *kset
                                        ...);

Thus, to add a new keyword, we add a new field to the structure and change
the implementation of get_keywords and the copy/translate. No changes to any
of the other files in SVN.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:56 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.