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

[RFC/PATCH] commit messages not 8-bit compatible

From: Ulf Tigerstedt <tiggi_at_infa.abo.fi>
Date: 2002-05-29 11:44:42 CEST

Not a correct patch, but something that needs to be fixed one
way or the other:

Problem: ĺäö (and other nonASCII chars)in commit messages makes the ra_dav
server barf over the commit.

The client tells:
svn_error: #21093 : <RA layer request failed>
  applying log message to
/lin24/$svn/wbl/d2c7f5da-d11d-b211-a802-896bfc595c95/17: 400 Bad Request
Apache tells:
[Wed May 29 12:06:02 2002] [error] [client 130.232.84.208] XML parser error
code: not well-formed (4)

... and so on.

A quick fix for $EDITOR made messages is below:
(against r2027)
Index: ./subversion/clients/cmdline/cl.h
===================================================================
--- ./subversion/clients/cmdline/cl.h
+++ ./subversion/clients/cmdline/cl.h Wed May 29 11:55:51 2002
@@ -361,6 +361,7 @@
 void *svn_cl__make_log_msg_baton (svn_cl__opt_state_t *opt_state,
                                   const char *base_dir,
                                   apr_pool_t *pool);
+void svn_strip_log_highbits(svn_stringbuf_t *buffer);
 
 /* A function of type svn_client_get_commit_log_t. */
 svn_error_t *svn_cl__get_log_message (const char **log_msg,
Index: ./subversion/clients/cmdline/util.c
===================================================================
--- ./subversion/clients/cmdline/util.c
+++ ./subversion/clients/cmdline/util.c Wed May 29 12:34:50 2002
@@ -492,7 +492,13 @@
   return buffer;
 }
 
-
+void
+svn_strip_log_highbits(svn_stringbuf_t *buffer) {
+ int i;
+ for (i=buffer->len; i!=0; i--) {
+ buffer->data[i]&=0x7F;
+ }
+}
 #define EDITOR_PREFIX_TXT "SVN:"
 
 /* This function is of type svn_client_get_commit_log_t. */
@@ -585,6 +591,7 @@
       /* Strip the prefix from the buffer. */
       if (message)
         message = strip_prefix_from_buffer (message, EDITOR_PREFIX_TXT,
pool);
+ svn_strip_log_highbits(message);
 
       if (message)
         {

Don't apply this, but please comment.
Should the messages be allowed to be 8bit, and is it the client or the
server that should correct it if needed?

-- 
****  Ulf 'Tiggi' Tigerstedt *** KTF / Datateknik  *********
*Being flogged with a rubber chicken can be quite enjoyable*
** - Matt McLeod, In the Scary devil monastery 29.11.1999 **
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 29 14:15:54 2002

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.