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

[PATCH v3] Change test suite to read file properties in XML format

From: Michael Haggerty <mhagger_at_alum.mit.edu>
Date: Tue, 28 Jul 2009 10:47:57 +0200

Thanks, everybody, for the feedback.

James Abbatiello wrote:
> 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.

Yes, of course you are right again.

This time I hand-tested against the output that you listed in your
previous email, and it seems to work. Third time's the charm?

Julian Foad wrote:
> Please state the main goal of making this part of the test suite
> compatible with the output of pre-1.6 svn, and the cvs2svn project's
> interest in this. And this change doesn't really make it shorter if you
> ignore the blank lines.

Suggestion incorporated.

Hyrum K. Wright wrote:
>> I don't think there is anything precluding the use of "svn proplist
>> > --xml" for svntest's property-checking functions.
> Julian Foad wrote
> Nor do I, just as long as we make sure to still test the "standard"
> output somewhere in the testsuite.

I just intentionally broke the code for "svn proplist -v" (without
--xml) and several test cases in prop_test.py broke. So there is at
least some level of testing aside from tree.get_props().

David Glasser wrote:
> The Python versions we support ship with an XML parser, right?

The xml.dom.minidom parser (which I'm using) was added in Python 2.0.


Read svn properties in XML rather than text format in test suite.

This makes the routine more robust to strange property values. It also
makes it immune to changes in the text output format, as happened
between svn 1.5 and 1.6. (This is useful for the cvs2svn project,
which uses the svntest infrastructure but doesn't want to care what
version of svn the user has installed.)

* subversion/tests/cmdline/svntest/tree.py
  (get_props): Read svn properties via "svn proplist -v" using the
  "--xml" option.


Received on 2009-07-28 10:48:24 CEST

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