Re: [PATCH v2] Change test suite to read file properties in XML format
James Abbatiello <[email protected]>
| Newsgroups | gmane.comp.version-control.subversion.cvs2svn.devel |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Jul 27, 2009 at 2:21 PM, Michael Haggerty<[email protected]> wrote: > James Abbatiello wrote: >> The '\r\n' sequences are being folded to '\n'. But then the XML >> parser turns '
\n' into '\r\n' in the final output. > > Yuck. I wonder whether the output contains ' \n' or ' \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 \r\n*.o \r\n*~ \r\n.*~ \r\n \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 " \n". And rstrip isn't going to match against encoded XML entities. You're either going to have to match against " \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://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1667&dsMessageId=2376109 To unsubscribe from this discussion, e-mail: [[email protected]].