You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by James Moger <Ja...@TRANSONIC.com> on 2004/05/11 20:35:03 UTC

SVN Log gotcha...

I recently converted a repository from P4 to SVN.  I have discovered that some of my imported log messages have characters like 0x96 that make the UTF-8 XML log message retrieval unhappy (but committing the message apparently worked).  Here is an example error output:


svn log http://odin/svn/trunk/java_unstable -r 264
svn: REPORT request failed on '/svn/!svn/bc/264/trunk/java_unstable'
svn: The REPORT request returned invalid XML in the response: XML parse error at
 line 8: not well-formed (invalid token) (/svn/!svn/bc/264/trunk/java_unstable)

Further investigation showed that those invalid characters are in my Perforce depot too.  Turns out one of the developers sometimes creates log messages/changelist comments with Word and then pastes them in - apparently some control or hidden characters must have been copied & pasted.

Just figured I would pass on that experience in case anyone else happens to stumble across that problem too.

Perhaps the svn client could fail with more details or maybe it could limp along and drop questionable characters?

Related to this...Is there a way to modify/edit a log message?
I haven't found one yet so the plan is to either redo the dump process (ugh) or try to edit the dump file to save time.

Thanks,
James


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: [PATCH] Re: SVN Log gotcha...

Posted by kf...@collab.net.
Michael W Thelen <th...@cs.utah.edu> writes:
> * Ben Collins-Sussman <su...@collab.net> [2004-05-11 14:41]:
> > (Anyone wanna write a patch to project_faq.html for this question?)
> 
> Sure... here's a patch.  Quite a bit of the wording is taken directly
> from the book, but put together in a way that (hopefully) makes a nice,
> bite-sized FAQ answer.
> 
> Log:
> Add a FAQ entry for "How can I change a log message?"

Committed in r9688 and web site updated.

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: [PATCH] Re: SVN Log gotcha...

Posted by kf...@collab.net.
Michael W Thelen <th...@cs.utah.edu> writes:
> * Ben Collins-Sussman <su...@collab.net> [2004-05-11 14:41]:
> > (Anyone wanna write a patch to project_faq.html for this question?)
> 
> Sure... here's a patch.  Quite a bit of the wording is taken directly
> from the book, but put together in a way that (hopefully) makes a nice,
> bite-sized FAQ answer.
> 
> Log:
> Add a FAQ entry for "How can I change a log message?"

Committed in r9688 and web site updated.

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[PATCH] Re: SVN Log gotcha...

Posted by Michael W Thelen <th...@cs.utah.edu>.
* Ben Collins-Sussman <su...@collab.net> [2004-05-11 14:41]:
> (Anyone wanna write a patch to project_faq.html for this question?)

Sure... here's a patch.  Quite a bit of the wording is taken directly
from the book, but put together in a way that (hopefully) makes a nice,
bite-sized FAQ answer.

Log:
Add a FAQ entry for "How can I change a log message?"

* www/project_faq.html
  (change-log-msg): New question and answer.

Index: www/project_faq.html
===================================================================
--- www/project_faq.html	(revision 9687)
+++ www/project_faq.html	(working copy)
@@ -55,6 +55,8 @@
 <li><a href="#reposperms">How do I set repository permissions correctly?</a></li>
 <li><a href="#readonly">Why do read-only operations still need repository write access?</a></li>
 <li><a href="#removal">How do I completely remove a file from the repository's history?</a></li>
+<li><a href="#change-log-msg">How do I change the log message for a revision
+    after it's been committed?</a></li>
 <li><a href="#patch">How do I submit a patch for Subversion?</a></li>
 <li><a href="#in-place-import">How can I do an in-place 'import'
     (i.e. add a tree to subversion without moving or deleting the
@@ -857,7 +859,57 @@
 href="http://svnbook.red-bean.com/html-chunk/ch05.html">chapter 5</a>
 of the Subversion book for details about this.</p>
 
+<![CDATA[=========================================================]]>
 
+<h3><a name="change-log-msg">
+How do I change the log message for a revision after it's been committed?
+</a></h3>
+
+<p>Log messages are kept in the repository as properties attached to each
+revision.  By default, the log message property (<em>svn:log</em>) cannot be
+edited once it is committed.  That is because changes to <a
+href="http://svnbook.red-bean.com/svnbook/ch05.html#svn-ch-5-sect-1.2">revision
+properties</a> (of which <em>svn:log</em> is one) cause the property's
+previous value to be permanently discarded, and Subversion tries to prevent
+you from doing this accidentally.  However, there are a couple of ways to get
+Subversion to change a revision property.</p>
+
+<p>The first way is for the repository administrator to enable revision
+property modifications.  This is done by creating a hook called
+"pre-revprop-change" (see <a
+href="http://svnbook.red-bean.com/svnbook/ch05s02.html#svn-ch-5-sect-2.1">this
+section</a> in the Subversion book for more details about how to do this).
+The "pre-revprop-change" hook has access to the old log message before it is
+changed, so it can preserve it in some way (for example, by sending an email).
+Once revision property modifications are enabled, you can change a revision's
+log message by passing the --revprop switch to <b>svn propedit</b> or <b>svn
+propset</b>, like either one of these:</p>
+
+<pre>
+$ svn propedit -r N --revprop svn:log URL
+$ svn propset -r N --revprop svn:log "new log message" URL
+</pre>
+
+<p>where N is the revision number whose log message you wish to change, and
+URL is the location of the repository.  If you run this command from within a
+working copy, you can leave off the URL.</p>
+
+<p>The second way of changing a log message is to use <b>svnadmin setlog</b>.
+This must be done by referring to the repository's location on the filesystem.
+You cannot modify a remote repository using this command.</p>
+
+<pre>
+$ svnadmin setlog REPOS_PATH -r N FILE
+</pre>
+
+<p>where REPOS_PATH is the repository location, N is the revision number whose
+log message you wish to change, and FILE is a file containing the new log
+message.  If the "pre-revprop-change" hook is not in place (or you want to
+bypass the hook script for some reason), you can also use the --bypass-hooks
+option.  However, if you decide to use this option, be very careful.  You may
+be bypassing such things as email notifications of the change, or backup
+systems that keep track of revision properties.</p>
+
 <![CDATA[=========================================================]]>
 
 <h3><a name="patch">How do I submit a patch for Subversion?</a></h3>

-- Mike

-- 
Michael W. Thelen
I never did give anybody hell.  I just told the truth and they thought it was
hell.           -- Harry S Truman

[PATCH] Re: SVN Log gotcha...

Posted by Michael W Thelen <th...@cs.utah.edu>.
* Ben Collins-Sussman <su...@collab.net> [2004-05-11 14:41]:
> (Anyone wanna write a patch to project_faq.html for this question?)

Sure... here's a patch.  Quite a bit of the wording is taken directly
from the book, but put together in a way that (hopefully) makes a nice,
bite-sized FAQ answer.

Log:
Add a FAQ entry for "How can I change a log message?"

* www/project_faq.html
  (change-log-msg): New question and answer.

Index: www/project_faq.html
===================================================================
--- www/project_faq.html	(revision 9687)
+++ www/project_faq.html	(working copy)
@@ -55,6 +55,8 @@
 <li><a href="#reposperms">How do I set repository permissions correctly?</a></li>
 <li><a href="#readonly">Why do read-only operations still need repository write access?</a></li>
 <li><a href="#removal">How do I completely remove a file from the repository's history?</a></li>
+<li><a href="#change-log-msg">How do I change the log message for a revision
+    after it's been committed?</a></li>
 <li><a href="#patch">How do I submit a patch for Subversion?</a></li>
 <li><a href="#in-place-import">How can I do an in-place 'import'
     (i.e. add a tree to subversion without moving or deleting the
@@ -857,7 +859,57 @@
 href="http://svnbook.red-bean.com/html-chunk/ch05.html">chapter 5</a>
 of the Subversion book for details about this.</p>
 
+<![CDATA[=========================================================]]>
 
+<h3><a name="change-log-msg">
+How do I change the log message for a revision after it's been committed?
+</a></h3>
+
+<p>Log messages are kept in the repository as properties attached to each
+revision.  By default, the log message property (<em>svn:log</em>) cannot be
+edited once it is committed.  That is because changes to <a
+href="http://svnbook.red-bean.com/svnbook/ch05.html#svn-ch-5-sect-1.2">revision
+properties</a> (of which <em>svn:log</em> is one) cause the property's
+previous value to be permanently discarded, and Subversion tries to prevent
+you from doing this accidentally.  However, there are a couple of ways to get
+Subversion to change a revision property.</p>
+
+<p>The first way is for the repository administrator to enable revision
+property modifications.  This is done by creating a hook called
+"pre-revprop-change" (see <a
+href="http://svnbook.red-bean.com/svnbook/ch05s02.html#svn-ch-5-sect-2.1">this
+section</a> in the Subversion book for more details about how to do this).
+The "pre-revprop-change" hook has access to the old log message before it is
+changed, so it can preserve it in some way (for example, by sending an email).
+Once revision property modifications are enabled, you can change a revision's
+log message by passing the --revprop switch to <b>svn propedit</b> or <b>svn
+propset</b>, like either one of these:</p>
+
+<pre>
+$ svn propedit -r N --revprop svn:log URL
+$ svn propset -r N --revprop svn:log "new log message" URL
+</pre>
+
+<p>where N is the revision number whose log message you wish to change, and
+URL is the location of the repository.  If you run this command from within a
+working copy, you can leave off the URL.</p>
+
+<p>The second way of changing a log message is to use <b>svnadmin setlog</b>.
+This must be done by referring to the repository's location on the filesystem.
+You cannot modify a remote repository using this command.</p>
+
+<pre>
+$ svnadmin setlog REPOS_PATH -r N FILE
+</pre>
+
+<p>where REPOS_PATH is the repository location, N is the revision number whose
+log message you wish to change, and FILE is a file containing the new log
+message.  If the "pre-revprop-change" hook is not in place (or you want to
+bypass the hook script for some reason), you can also use the --bypass-hooks
+option.  However, if you decide to use this option, be very careful.  You may
+be bypassing such things as email notifications of the change, or backup
+systems that keep track of revision properties.</p>
+
 <![CDATA[=========================================================]]>
 
 <h3><a name="patch">How do I submit a patch for Subversion?</a></h3>

-- Mike

-- 
Michael W. Thelen
I never did give anybody hell.  I just told the truth and they thought it was
hell.           -- Harry S Truman

Re: SVN Log gotcha...

Posted by Ben Collins-Sussman <su...@collab.net>.
On Tue, 2004-05-11 at 15:35, James Moger wrote:

> Related to this...Is there a way to modify/edit a log message?

1. Make sure you have a 'pre-revprop-change' hook script in your repos.

2. svn propedit -r N --revprop svn:log URL


(Anyone wanna write a patch to project_faq.html for this question?)



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org