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

Re: [PATCH v2] Change test suite to read file properties in XML format

From: James Abbatiello <abbeyj_at_gmail.com>
Date: Mon, 27 Jul 2009 15:18:35 -0400

On Mon, Jul 27, 2009 at 2:21 PM, Michael Haggerty<mhagger_at_alum.mit.edu> wrote:
> James Abbatiello wrote:
>> The '\r\n' sequences are being folded to '\n'.  But then the XML
>> parser turns '&#13\n' into '\r\n' in the final output.
>
> Yuck.  I wonder whether the output contains '&#13;\n' or '&#13;\r\n'
> (i.e., does the output contain one or two extraneous CR characters?

>>> stdin, stdout, stderr, kid = svntest.main.open_pipe(["svn", "proplist", "--verbose", "--xml", "svntest"])
>>> stdout.read()
'<?xml version="1.0"?>\r\n<properties>\r\n<target\r\n
path="svntest">\r\n<property\r\n
name="svn:ignore">*.pyc&#13;\r\n*.o&#13;\r\n*~&#13;\r\n.*~&#13;\r\n&#13;\r\n</property>\r\n</target>\r\n</properties>\r\n'

> In any case, I'm defeated.  Attached is a patch like the previous one,
> except that it also smashes all EOL combinations into '\n'.  Feedback is
> welcome, especially from Windows users.

Sorry, it still doesn't work.
>>> svntest.tree.get_props(["svntest"])
{u'svntest': {u'svn:ignore': u'*.pyc\r\n*.o\r\n*~\r\n.*~\r\n\r\n'}}

You do the folding at the top of the function. As you noted,
wait_on_pipe() already does basically the same thing so that by the
time the strings get to you they end with "&#13;\n". And rstrip isn't
going to match against encoded XML entities. You're either going to
have to match against "&#13;\n" at the end of the line (ick) or wait
until after the XML parser has had a shot at it and adjust the line
endings then.

-- 
James Abbatiello
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2376110
Received on 2009-07-27 21:39:39 CEST

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