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

Re: [PATCH] --native-eol option support for checkout and update, fixed version

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2007-01-23 14:30:13 CET

Pavel Fedin wrote:
> Hello all!
> This is the second version of the patch. This version fixes the
> serious bug: --native-eol was previously forced for all files and this
> broke binary files in the repository. Now --native-eol is applied only
> to files with "svn:eol-style" property set to "native".
> The patch applies to 1.4.2 release.

[...]

> diff -ru subversion-1.4.2-orig/subversion/libsvn_wc/translate.c subversion-1.4.2/subversion/libsvn_wc/translate.c
> --- subversion-1.4.2-orig/subversion/libsvn_wc/translate.c 2006-08-03 00:24:26.000000000 +0400
> +++ subversion-1.4.2/subversion/libsvn_wc/translate.c 2007-01-23 10:33:56.000000000 +0300

[...]

>
> +svn_error_t *
> +svn_wc__get_eol_style2(svn_subst_eol_style_t *style,
> + const char **eol,
> + const char *path,
> + const char *native_eol_requested,
> + svn_wc_adm_access_t *adm_access,
> + apr_pool_t *pool)
> +{
> + const svn_string_t *propval;
> + const char *eol_val = NULL;
> +
> + /* Get the property value. */
> + SVN_ERR(svn_wc_prop_get(&propval, SVN_PROP_EOL_STYLE, path, adm_access,
> + pool));
> + if (propval)
> + eol_val = propval->data;
> + if (eol_val) {
> + if ((!strcmp("native", eol_val)) && native_eol_requested)
> + eol_val = native_eol_requested;
> + }
> +
> + /* Convert it. */
> + svn_subst_eol_style_from_value(style, eol, eol_val);
> +
> + return SVN_NO_ERROR;
> +}
>
> svn_error_t *
> svn_wc__get_eol_style(svn_subst_eol_style_t *style,
> diff -ru subversion-1.4.2-orig/subversion/libsvn_wc/translate.h subversion-1.4.2/subversion/libsvn_wc/translate.h
> --- subversion-1.4.2-orig/subversion/libsvn_wc/translate.h 2006-02-15 21:30:50.000000000 +0300
> +++ subversion-1.4.2/subversion/libsvn_wc/translate.h 2006-12-18 13:19:18.000000000 +0300
> @@ -42,6 +42,8 @@
> - a null-terminated C string containing the eol marker indicated
> by the property value, for svn_subst_eol_style_fixed.
>
> + If native_eol_requested is not null, it overrides the property value.
> +
> If STYLE is null on entry, ignore it. If *EOL is non-null on exit,
> it is a static string not allocated in POOL.
>
> @@ -49,6 +51,13 @@
>
> Use POOL for temporary allocation.
> */
> +svn_error_t *svn_wc__get_eol_style2(svn_subst_eol_style_t *style,
> + const char **eol,
> + const char *path,
> + const char *native_eol_requested,
> + svn_wc_adm_access_t *adm_access,
> + apr_pool_t *pool);
> +
> svn_error_t *svn_wc__get_eol_style(svn_subst_eol_style_t *style,
> const char **eol,
> const char *path,

I see two problems here, but their resolution is the same:

   * In creating the prototype for svn_wc__get_eol_style2(), you left
     svn_wc__get_eol_style() without a docstring.

   * But you don't need to create svn_wc__get_eol_style2() at all --
     svn_wc__get_eol_style() is a library-private function, so you can
     just add the new 'native_eol_requested' parameter.

-- 
C. Michael Pilato <cmpilato@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on Tue Jan 23 14:30:57 2007

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