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

How should I properly escape special characters in commit message?

From: melmack melmack <melmack3_at_gmail.com>
Date: 2007-12-09 17:03:54 CET

Hello

I've one problem with escaping special characters (quotes and backslashes)
in commit message. To explain it better I'll show 2 examples (both in Win32
cmd.exe shell):

(1) svn commit -m "foo\\\"bar"

Comment is saved to svn as foo\"bar

(2) svn commit -m "foo\\\\bar"

Comment is saved to svn as foo\\\\bar

What is the reason of the fact that in example (1) svn interpreter collapses
\\ to \ and \" to " (as in regular expressions syntax) and in example (2)
nothing is collapsed? I thought that example(2) should have saved \\ as
comment. Why was the result different? So how should I escape the comments
properly? Is there an algorithm to do this?
My temporary solution to solve this problem is putting comment to file and
call svn vommit with -F option but this is inefficient way, so any help will
be appreciated...

Best regards
Melmack
Received on Sun Dec 9 17:04:19 2007

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.