From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: Using UTF-8 encodings for SVN commit message Date: Wed, 24 Jan 2007 22:19:01 -0600 Message-ID: <45B82FB5.4080905@cs.utexas.edu> References: <45B821DC.5020200@cs.utexas.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020005090108050602000001" To: kvm-devel Return-path: In-Reply-To: <45B821DC.5020200-NZpS4cJIG2HvQtjrzfazuQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --------------020005090108050602000001 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit FYI, the follow patch is a work-around for this particular problem. It'll only work for this particular changeset but just in case anyone else is interested in using tailor with KVM I thought I'd post it. Regards, Anthony Liguori Anthony Liguori wrote: > Howdy, > > I have a bit of an odd request. I've been using tailor to mirror KVM in > mercurial which is my preferred SCM. This has worked quite well up > until sometime in December when tailor started throwing errors. > > I finally got around to looking into it and discovered the source of the > problem. It seems that on December 26th, Avi committed a patch from > Yoshimi Ichiyanagi "kvm: initialize kvm_arch_ops in kvm_init()". > > The problem is that the commit message (which was likely copy-pasted > from an email) contains a character that is neither ASCII nor is it > UTF-8. SVN commit messages should be encoded in UTF-8. The reason for > this is that SVN allows exporting information about the repository in > XML which is marked as UTF-8 encoded. > > If commit messages aren't valid UTF-8, SVN generates invalid XML. While > SVN should probably generate an error when committing non-UTF8 messages, > we shouldn't be doing it in the first place. > > Is there any way to fix this? I'm going to try to find a way to hack > around it in tailor but I suspect this will break other SVN tools too. > > If nothing else, I was hoping we could be a bit more careful about this > in the future (if that's at all possible). > > Thanks! > > Regards, > > Anthony Liguori > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV --------------020005090108050602000001 Content-Type: text/x-patch; name="tailor-jp.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tailor-jp.diff" --- vcpx/repository/svn.py 2006-12-11 15:08:24.000000000 -0600 +++ /usr/lib/python2.4/site-packages/vcpx/repository/svn.py 2007-01-24 22:16:37.000000000 -0600 @@ -299,9 +299,19 @@ parser.setContentHandler(handler) parser.setErrorHandler(ErrorHandler()) + def scrub(text): + scrubbed_text = '' + i = text.find('\x1b') + while i != -1: + scrubbed_text += text[0:i] + text = text[i+3:] + i = text.find('\x1b') + scrubbed_text += text + return scrubbed_text + chunk = log.read(chunksize) while chunk: - parser.feed(chunk) + parser.feed(scrub(chunk)) for cs in handler.changesets: yield cs handler.changesets = [] --------------020005090108050602000001 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV --------------020005090108050602000001 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------020005090108050602000001--