From 926d0cfec09192a0c32f31a98704ebf49a28ea47 Mon Sep 17 00:00:00 2001 From: Julian Foad Date: Wed, 13 Aug 2008 23:57:56 +0000 Subject: [PATCH] In the test suite's checking of multi-line property values, fix a line-ending quirk and make the parsing a bit more robust and simpler. * subversion/tests/cmdline/merge_tests.py (avoid_repeated_merge_on_subtree_with_merge_info, merge_old_and_new_revs_from_renamed_dir, merge_source_normalization_and_subtree_merges, dont_add_mergeinfo_from_own_history): Remove the spurious newline from the end of the expected mergeinfo value. * subversion/tests/cmdline/svntest/tree.py (get_props): Don't add an extra newline to a multi-line property value. Be more careful in matching a property name line. When stripping the line-ending characters, avoid accidentally stripping other white space from the beginning or end of a line. git-svn-id: http://svn.apache.org/repos/asf/subversion/trunk/subversion/tests/cmdline@872537 13f79535-47bb-0310-9956-ffa450edef68 --- svntest/tree.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/svntest/tree.py b/svntest/tree.py index f4f6ac8..c8c24a2 100644 --- a/svntest/tree.py +++ b/svntest/tree.py @@ -323,23 +323,15 @@ def get_props(path): props = {} exit_code, output, errput = main.run_svn(1, "proplist", path, "--verbose") - first_value = 0 for line in output: if line.startswith('Properties on '): continue - # Not a misprint; "> 0" really is preferable to ">= 0" in this case. - if line.find(' : ') > 0: + if line.startswith(' ') and line.find(' : ') >= 3: name, value = line.split(' : ') - name = name.strip() - value = value.strip() + name = name[2:] + value = value.rstrip("\r\n") props[name] = value - first_value = 1 else: # Multi-line property, so re-use the current name. - if first_value: - # Undo, as best we can, the strip(value) that was done before - # we knew this was a multiline property. - props[name] = props[name] + "\n" - first_value = 0 # Keep the line endings consistent with what was done to the first # line by stripping whitespace and then appending a newline. This # prevents multiline props on Windows that must be stored as UTF8/LF @@ -357,7 +349,7 @@ def get_props(path): # from looking like this in the returned PROPS hash: # # "propname" --> "propvalLine1propvalLine2propvalLine3" - props[name] = props[name] + line.strip() + "\n" + props[name] = props[name] + "\n" + line.rstrip("\r\n") return props -- 2.11.4.GIT