B Smith-Mannschott wrote on Sat, 28 Mar 2009 at 12:43 +0100:
> As I understand it the Subversion server 1.6.x will refuse these kinds
> of commits, even without a hook script, yes?
> 
Yes.
> I've made a hacked-up variant of svnsync which will correct impure
> eol-style in property values where the real 1.6.0 complains and dies.
> (see patch at end of mail).
> 
> This is obviously not a permanent solution.
> 
> ---------------------
> Don't try this at home kids: this is an *evil* hack. A validation
> function which mutates an input marked as const is truly not a pretty
> sight.
> 
Less evil would be to change svnsync itself rather than the validation
logic --- see how subversion/svnsync/main.c handles the
SVNSYNC_UNSUPPORTED_STRIP_MERGEINFO flag.  That way you also wouldn't have 
to modify consts.
> --- a/subversion/libsvn_repos/fs-wrap.c
> +++ b/subversion/libsvn_repos/fs-wrap.c
> @@ -182,15 +182,15 @@ validate_prop(const char *name, const
> svn_string_t *value, apr_pool_t *pool)
>                     "UTF-8"), name);
>              }
> 
> -          /* Disallow inconsistent line ending style, by simply looking for
> -           * carriage return characters ('\r'). */
> -          if (strchr(value->data, '\r') != NULL)
> -            {
> -              return svn_error_createf
> -                (SVN_ERR_BAD_PROPERTY_VALUE, NULL,
> -                 _("Cannot accept non-LF line endings in '%s' property"),
> -                   name);
> -            }
> +          /* Evil hack: replace '\r' in property value with space to
> +           * maintain eol-style purity. */
> +          {
> +            char * p = value->data;
> +            while (p = strchr(p, '\r'))
> +              {
> +                *p = ' ';
> +              }
> +          }
>          }
> 
Nice idea. :-)
/* five minutes later... */
But doesn't it get you an infinite loop whenever the property sync'd 
contains a '\r'?
>        /* "svn:date" should be a valid date. */
> 
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1455021
> 
> To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1455702
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-03-28 22:29:34 CET