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

Re: svnsync 1.6.0 fails to sync repositories with ^M in an svn:ignore

From: B Smith-Mannschott <bsmith.occs_at_gmail.com>
Date: Sat, 28 Mar 2009 12:43:26 +0100

Thanks for the feedback. What I've done for the moment is this:

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.

Our central Subversion server will be seeing an upgrade from 1.4.x to
1.6.x sometime before summer (one hopes). At this point I'd like to
have our repositories dumped and reloaded anyway to be able to make
best use of the improvements in 1.5.x and 1.6.x. This would be a
natural time to filter through the whole dump file correcting the (no
doubt numerous) eol-style impurities. (A lot of us here use
RAD+Subclipse on Windows).

I don't intend to write a hook script to prevent this kind of
corruption. Even if I catch new errors of this kind, I'll still need
to clean up the dump repository when we transition to 1.6.x because of
the errors that have already crept in. As I understand it the
Subversion server 1.6.x will refuse these kinds of commits, even
without a hook script, yes?

---------------------
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.

--- 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 = ' ';
+ }
+ }
         }

       /* "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].
Received on 2009-03-28 12:44:18 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.