Author: stsp
Date: Tue Sep 11 10:03:11 2012
New Revision: 1383334

URL: http://svn.apache.org/viewvc?rev=1383334&view=rev
Log:
On the 1.6.x-testsuite-apr-hash-order branch, merge the following revisions
from trunk, resolving conflicts: r1240619, r1241626, r1291429, r1291446,
r1291520, r1291680, r1291704, and r1291726.

Allows the following tests to pass reliably with APR-1.4.6:

diff_tests.py 14: diff text-bases against repository
switch_tests.py 23: mergeinfo does not elide post switch
update_tests.py 36: mergeinfo does not elide after update
svnlook_tests.py 1: test miscellaneous svnlook features
svnlook_tests.py 11: test 'svnlook * -t'

Modified:
    subversion/branches/1.6.x-testsuite-apr-hash-order/   (props changed)
    
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/diff_tests.py
    
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/svnlook_tests.py
    
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/svntest/actions.py
    
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/switch_tests.py
    
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/update_tests.py

Propchange: subversion/branches/1.6.x-testsuite-apr-hash-order/
------------------------------------------------------------------------------
  Merged 
/subversion/trunk:r1240619,1241626,1291429,1291446,1291520,1291680,1291704,1291726

Modified: 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/diff_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/diff_tests.py?rev=1383334&r1=1383333&r2=1383334&view=diff
==============================================================================
--- 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/diff_tests.py
 (original)
+++ 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/diff_tests.py
 Tue Sep 11 10:03:11 2012
@@ -1024,8 +1024,10 @@ def diff_base_to_repos(sbox):
     if not re_infoline.match(line):
       list2.append(line)
 
-  if list1 != list2:
-    raise svntest.Failure
+  # Two files in diff may be in any order.
+  list1 = svntest.verify.UnorderedOutput(list1)
+
+  svntest.verify.compare_and_display_lines('', '', list1, list2)
 
 
 #----------------------------------------------------------------------

Modified: 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/svnlook_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/svnlook_tests.py?rev=1383334&r1=1383333&r2=1383334&view=diff
==============================================================================
--- 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/svnlook_tests.py
 (original)
+++ 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/svnlook_tests.py
 Tue Sep 11 10:03:11 2012
@@ -105,35 +105,39 @@ def test_misc(sbox):
   # the 'svnlook tree --full-paths' output if demanding the whole repository
   treelist = run_svnlook('tree', repo_dir)
   treelistfull = run_svnlook('tree', '--full-paths', repo_dir)
+
   path = ''
-  n = 0
+  treelistexpand = []
   for entry in treelist:
     len1 = len(entry)
     len2 = len(entry.lstrip())
-    path = path[0:2*(len1-len2)-1] + entry.strip()
-    test = treelistfull[n].rstrip()
-    if n != 0:
-      test = "/" + test
-    if not path == test:
-      print("Unexpected result from tree with --full-paths:")
-      print("  entry            : %s" % entry.rstrip())
-      print("  with --full-paths: %s" % treelistfull[n].rstrip())
-      raise svntest.Failure
-    n = n + 1
+    path = path[0:2*(len1-len2)-1] + entry.strip() + '\n'
+    if path == '/\n':
+      treelistexpand.append(path)
+    else:
+      treelistexpand.append(path[1:])
+
+  treelistexpand = svntest.verify.UnorderedOutput(treelistexpand)
+  svntest.verify.compare_and_display_lines('Unexpected result from tree', '',
+                                           treelistexpand, treelistfull)
 
   # check if the 'svnlook tree' output is the ending of
   # the 'svnlook tree --full-paths' output if demanding
   # any part of the repository
-  n = 0
   treelist = run_svnlook('tree', repo_dir, '/A/B')
   treelistfull = run_svnlook('tree', '--full-paths', repo_dir, '/A/B')
+
+  path = ''
+  treelistexpand = []
   for entry in treelist:
-    if not treelistfull[n].endswith(entry.lstrip()):
-      print("Unexpected result from tree with --full-paths:")
-      print("  entry            : %s" % entry.rstrip())
-      print("  with --full-paths: %s" % treelistfull[n].rstrip())
-      raise svntest.Failure
-    n = n + 1
+    len1 = len(entry)
+    len2 = len(entry.lstrip())
+    path = path[0:2*(len1-len2)] + entry.strip() + '\n'
+    treelistexpand.append('/A/' + path)
+
+  treelistexpand = svntest.verify.UnorderedOutput(treelistexpand)
+  svntest.verify.compare_and_display_lines('Unexpected result from tree', '',
+                                           treelistexpand, treelistfull)
 
   treelist = run_svnlook('tree', repo_dir, '/')
   if treelist[0] != '/\n':
@@ -621,7 +625,7 @@ fp.close()"""
                     #  internal property, not really expected
                     '  svn:check-locks\n',
                     '  bogus_rev_prop\n', '  svn:date\n']
-  verify_logfile(logfilepath, expected_data)
+  verify_logfile(logfilepath, svntest.verify.UnorderedOutput(expected_data))
 
 ########################################################################
 # Run the tests

Modified: 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/svntest/actions.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/svntest/actions.py?rev=1383334&r1=1383333&r2=1383334&view=diff
==============================================================================
--- 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/svntest/actions.py
 (original)
+++ 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/svntest/actions.py
 Tue Sep 11 10:03:11 2012
@@ -902,13 +902,21 @@ def run_and_verify_merge2(dir, rev1, rev
   if dry_run and out != out_dry:
     # Due to the way ra_serf works, it's possible that the dry-run and
     # real merge operations did the same thing, but the output came in
-    # a different order.  Let's see if maybe that's the case.
+    # a different order.  Let's see if maybe that's the case by comparing
+    # the outputs as unordered sets rather than as lists.
     #
-    # NOTE:  Would be nice to limit this dance to serf tests only, but...
-    out_copy = out[:]
-    out_dry_copy = out_dry[:]
-    out_copy.sort()
-    out_dry_copy.sort()
+    # This now happens for other RA layers with modern APR because the
+    # hash order now varies.
+    #
+    # The different orders of the real and dry-run merges may cause
+    # the "Merging rX through rY into" lines to be duplicated a
+    # different number of times in the two outputs.  The list-set
+    # conversion removes duplicates so these differences are ignored.
+    # It also removes "U some/path" duplicate lines.  Perhaps we
+    # should avoid that?
+    out_copy = set(out[:])
+    out_dry_copy = set(out_dry[:])
+
     if out_copy != out_dry_copy:
       print("=============================================================")
       print("Merge outputs differ")

Modified: 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/switch_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/switch_tests.py?rev=1383334&r1=1383333&r2=1383334&view=diff
==============================================================================
--- 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/switch_tests.py
 (original)
+++ 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/switch_tests.py
 Tue Sep 11 10:03:11 2012
@@ -1541,33 +1541,29 @@ def mergeinfo_switch_elision(sbox):
   beta_path     = os.path.join(wc_dir, "A", "B", "E", "beta")
 
   # Make branches A/B_COPY_1 and A/B_COPY_2
-  svntest.actions.run_and_verify_svn(
-    None,
-    ["A    " + os.path.join(wc_dir, "A", "B_COPY_1", "lambda") + "\n",
+  expected_stdout = svntest.verify.UnorderedOutput([
+     "A    " + os.path.join(wc_dir, "A", "B_COPY_1", "lambda") + "\n",
      "A    " + os.path.join(wc_dir, "A", "B_COPY_1", "E") + "\n",
      "A    " + os.path.join(wc_dir, "A", "B_COPY_1", "E", "alpha") + "\n",
      "A    " + os.path.join(wc_dir, "A", "B_COPY_1", "E", "beta") + "\n",
      "A    " + os.path.join(wc_dir, "A", "B_COPY_1", "F") + "\n",
      "Checked out revision 1.\n",
-     "A         " + B_COPY_1_path + "\n"],
-    [],
-    'copy',
-    sbox.repo_url + "/A/B",
-    B_COPY_1_path)
-
-  svntest.actions.run_and_verify_svn(
-    None,
-    ["A    " + os.path.join(wc_dir, "A", "B_COPY_2", "lambda") + "\n",
+     "A         " + B_COPY_1_path + "\n",
+    ])
+  svntest.actions.run_and_verify_svn(None, expected_stdout, [], 'copy',
+                                     sbox.repo_url + "/A/B", B_COPY_1_path)
+
+  expected_stdout = svntest.verify.UnorderedOutput([
+     "A    " + os.path.join(wc_dir, "A", "B_COPY_2", "lambda") + "\n",
      "A    " + os.path.join(wc_dir, "A", "B_COPY_2", "E") + "\n",
      "A    " + os.path.join(wc_dir, "A", "B_COPY_2", "E", "alpha") + "\n",
      "A    " + os.path.join(wc_dir, "A", "B_COPY_2", "E", "beta") + "\n",
      "A    " + os.path.join(wc_dir, "A", "B_COPY_2", "F") + "\n",
      "Checked out revision 1.\n",
-     "A         " + B_COPY_2_path + "\n"],
-    [],
-    'copy',
-    sbox.repo_url + "/A/B",
-    B_COPY_2_path)
+     "A         " + B_COPY_2_path + "\n",
+    ])
+  svntest.actions.run_and_verify_svn(None, expected_stdout, [], 'copy',
+                                     sbox.repo_url + "/A/B", B_COPY_2_path)
 
   expected_output = svntest.wc.State(wc_dir, {
     'A/B_COPY_1' : Item(verb='Adding'),

Modified: 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/update_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/update_tests.py?rev=1383334&r1=1383333&r2=1383334&view=diff
==============================================================================
--- 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/update_tests.py
 (original)
+++ 
subversion/branches/1.6.x-testsuite-apr-hash-order/subversion/tests/cmdline/update_tests.py
 Tue Sep 11 10:03:11 2012
@@ -2849,19 +2849,17 @@ def mergeinfo_update_elision(sbox):
   lambda_path = os.path.join(wc_dir, "A", "B", "lambda")
 
   # Make a branch A/B_COPY
-  svntest.actions.run_and_verify_svn(
-    None,
-    ["A    " + os.path.join(wc_dir, "A", "B_COPY", "lambda") + "\n",
+  expected_stdout =  svntest.verify.UnorderedOutput([
+     "A    " + os.path.join(wc_dir, "A", "B_COPY", "lambda") + "\n",
      "A    " + os.path.join(wc_dir, "A", "B_COPY", "E") + "\n",
      "A    " + os.path.join(wc_dir, "A", "B_COPY", "E", "alpha") + "\n",
      "A    " + os.path.join(wc_dir, "A", "B_COPY", "E", "beta") + "\n",
      "A    " + os.path.join(wc_dir, "A", "B_COPY", "F") + "\n",
      "Checked out revision 1.\n",
-     "A         " + B_COPY_path + "\n"],
-    [],
-    'copy',
-    sbox.repo_url + "/A/B",
-    B_COPY_path)
+     "A         " + B_COPY_path + "\n",
+    ])
+  svntest.actions.run_and_verify_svn(None, expected_stdout, [], 'copy',
+                                     sbox.repo_url + "/A/B", B_COPY_path)
 
   expected_output = wc.State(wc_dir, {'A/B_COPY' : Item(verb='Adding')})
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)


Reply via email to