You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/07/11 12:26:26 UTC

svn commit: r1360103 [17/18] - in /subversion/branches/ev2-export: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ build/win32/ contrib/server-side/ notes/wc-ng/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/o...

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/merge_symmetric_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/merge_symmetric_tests.py?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/merge_symmetric_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/merge_symmetric_tests.py Wed Jul 11 10:26:19 2012
@@ -46,6 +46,7 @@ from svntest.main import server_has_merg
 from merge_tests import local_path
 from merge_tests import expected_merge_output
 from merge_tests import svn_merge
+from merge_tests import set_up_branch
 
 #----------------------------------------------------------------------
 
@@ -127,7 +128,17 @@ from merge_tests import svn_merge
 #
 #   Subtree mergeinfo
 #
-#     ...
+#     subtree to, fro
+#     A (--o-o-o-o---------x
+#       ( \         \     /
+#       (  \         \   /
+#     B (   o--o------s--
+#
+#     merge to, reverse cherry subtree to, merge to
+#     A (--o-o-o-o------------------
+#       ( \         \        \     \
+#       (  \         \        \     \
+#     B (   o--o------x-------rcs----x
 #
 #   Sparse WC
 #
@@ -142,9 +153,11 @@ from merge_tests import svn_merge
 #
 #   o   - an original change
 #   ?   - an original change or no-op (test both)
-#   x   - a merge
+#   x   - a branch root merge
 #   c   - a cherry-pick merge
 #   [o] - source range of a cherry-pick merge
+#   s   - a subtree merge
+#   r   - reverse merge
 
 
 ########################################################################
@@ -737,6 +750,242 @@ def cherry3_fwd(sbox):
                   expect_mi=[7, 8, 9],
                   expect_3ways=[three_way_merge('A8', 'A9')])
 
+#----------------------------------------------------------------------
+# Symmetric merges ignore subtree mergeinfo during reintegrate.
+@SkipUnless(server_has_mergeinfo)
+@XFail()
+def subtree_to_and_fro(sbox):
+  "reintegrate considers source subtree mergeinfo"
+
+#     A (--o-o-o-o---------x
+#       ( \         \     /
+#       (  \         \   /
+#     B (   o--o------s--
+
+  # Some paths we'll care about.
+  A_COPY_gamma_path = sbox.ospath('A_COPY/D/gamma')
+  psi_path = sbox.ospath('A/D/H/psi')
+  A_COPY_D_path = sbox.ospath('A_COPY/D')
+  A_path = sbox.ospath('A')
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Setup a simple 'trunk & branch': Copy ^/A to ^/A_COPY in r2 and then
+  # make a few edits under A in r3-6:
+  wc_disk, wc_status = set_up_branch(sbox)
+
+  # r7 - Edit a file on the branch.
+  svntest.main.file_write(A_COPY_gamma_path, "Branch edit to 'gamma'.\n")
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir,
+                                     '-m', 'Edit a file on our branch')
+
+  # r8 - Do a subtree sync merge from ^/A/D to A_COPY/D.
+  # Note that among other things this changes A_COPY/D/H/psi.
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '--symmetric',
+                                     sbox.repo_url + '/A/D', A_COPY_D_path)
+
+  # r9 - Make an edit to A/D/H/psi.
+  svntest.main.file_write(psi_path, "Trunk Edit to 'psi'.\n")
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir,
+                                     '-m', 'Edit a file on our trunk')
+
+  # Now reintegrate ^/A_COPY back to A.  To the symmetric merge code the
+  # subtree merge to A_COPY/D just looks like any other branch edit, it is
+  # not considered a merge.  So the changes which exist on A/D and were
+  # merged to A_COPY/D, are merged *back* to A, resulting in a conflict:
+  #
+  #   C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\
+  #     working_copies\merge_symmetric_tests-18>svn merge ^^/A_COPY A
+  #     --symmetric
+  #   DBG: merge.c:11461: base on source: file:///C:/SVN/src-trunk/Debug/
+  #     subversion/tests/cmdline/svn-test-work/repositories/
+  #     merge_symmetric_tests-18/A@1
+  #   DBG: merge.c:11462: base on target: file:///C:/SVN/src-trunk/Debug/
+  #     subversion/tests/cmdline/svn-test-work/repositories/
+  #     merge_symmetric_tests-18/A@1
+  #   DBG: merge.c:11567: yca   file:///C:/SVN/src-trunk/Debug/subversion/
+  #     tests/cmdline/svn-test-work/repositories/merge_symmetric_tests-18/A@1
+  #   DBG: merge.c:11568: base  file:///C:/SVN/src-trunk/Debug/subversion/
+  #     tests/cmdline/svn-test-work/repositories/merge_symmetric_tests-18/A@1
+  #   DBG: merge.c:11571: right file:///C:/SVN/src-trunk/Debug/subversion/
+  #     tests/cmdline/svn-test-work/repositories/merge_symmetric_tests-18/
+  #     A_COPY@8
+  #   Conflict discovered in file 'A\D\H\psi'.
+  #   Select: (p) postpone, (df) diff-full, (e) edit,
+  #           (mc) mine-conflict, (tc) theirs-conflict,
+  #           (s) show all options: p
+  #   --- Merging r2 through r8 into 'A':
+  #   C    A\D\H\psi
+  #   U    A\D\gamma
+  #   --- Recording mergeinfo for merge of r2 through r8 into 'A':
+  #    U   A
+  #   Summary of conflicts:
+  #     Text conflicts: 1
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+  exit_code, out, err = svntest.actions.run_and_verify_svn(
+    None, [], svntest.verify.AnyOutput,
+    'merge', '--symmetric', sbox.repo_url + '/A_COPY', A_path)
+
+  # The 'old' merge produced a warning that reintegrate could not be used.
+  # Not claiming this is perfect, but it's better(?) than a conflict:
+  svntest.verify.verify_outputs("Symmetric Reintegrate failed, but not "
+                                "in the way expected",
+                                err, None,
+                                "(svn: E195016: Reintegrate can only be used if "
+                                "revisions 2 through 8 were previously "
+                                "merged from .*/A to the reintegrate source, "
+                                "but this is not the case:\n)"
+                                "|(  A_COPY\n)"
+                                "|(    Missing ranges: /A:5\n)"
+                                "|(\n)"
+                                "|(.*apr_err.*)", # In case of debug build
+                                None,
+                                True) # Match *all* lines of stdout  
+
+#----------------------------------------------------------------------
+# Symmetric merges ignore subtree mergeinfo gaps older than the last rev
+# synced to the target root.
+@SkipUnless(server_has_mergeinfo)
+def merge_to_reverse_cherry_subtree_to_merge_to(sbox):
+  "sync merge considers target subtree mergeinfo"
+
+  #   A (--o-o-o-o------------------
+  #     ( \         \        \     \
+  #     (  \         \        \     \
+  #   B (   o--o------x-------rc-----x
+
+  # Some paths we'll care about.
+  A_COPY_path = sbox.ospath('A_COPY')
+  A_COPY_B_path = sbox.ospath('A_COPY/B')
+  A_COPY_beta_path = sbox.ospath('A_COPY/B/E/beta')
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Setup a simple 'trunk & branch': Copy ^/A to ^/A_COPY in r2 and then
+  # make a few edits under A in r3-6:
+  wc_disk, wc_status = set_up_branch(sbox)
+
+  # Sync merge ^/A to A_COPY, then reverse merge r5 from ^/A/B to A_COPY/B.
+  # This results in mergeinfo on the target which makes it appear that the
+  # branch is synced up to r6, but the subtree mergeinfo on A_COPY/B reveals
+  # that r5 has not been merged to that subtree:
+  #
+  #   Properties on 'A_COPY':
+  #     svn:mergeinfo
+  #       /A:2-6
+  #   Properties on 'A_COPY\B':
+  #     svn:mergeinfo
+  #       /A/B:2-4,6
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '--symmetric',
+                                     sbox.repo_url + '/A', A_COPY_path)
+  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c-5',
+                                     sbox.repo_url + '/A/B',
+                                     A_COPY_B_path)
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir, '-m',
+                                     'sync merge and reverse subtree merge')
+
+  # Try a symmetric sync merge from ^/A to A_COPY.  Revision 5 should be
+  # merged to A_COPY/B as its subtree mergeinfo reveals that rev is missing,
+  # like so:
+  # 
+  #   >svn merge ^/A A_COPY
+  #   --- Merging r5 into 'A_COPY\B':
+  #   U    A_COPY\B\E\beta
+  #   --- Recording mergeinfo for merge of r5 through r7 into 'A_COPY':
+  #    U   A_COPY
+  #   --- Recording mergeinfo for merge of r5 through r7 into 'A_COPY\B':
+  #    U   A_COPY\B
+  #   --- Eliding mergeinfo from 'A_COPY\B':
+  #    U   A_COPY\B
+  #
+  # But the --symmetric merge ignores the subtree mergeinfo and considers
+  # only the mergeinfo on the target itself (and thus is a no-op but for
+  # the mergeinfo change on the root of the merge target):
+  #
+  #   >svn merge ^/A A_COPY --symmetric
+  #   --- Recording mergeinfo for merge of r7 into 'A_COPY':
+  #    U   A_COPY
+  #
+  #   >svn diff
+  #   Index: A_COPY
+  #   ===================================================================
+  #   --- A_COPY      (revision 7)
+  #   +++ A_COPY      (working copy)
+  #
+  #   Property changes on: A_COPY
+  #   ___________________________________________________________________
+  #   Modified: svn:mergeinfo
+  #      Merged /A:r7
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+  expected_output = wc.State(A_COPY_path, {
+    'B/E/beta'   : Item(status='U '),
+    })
+  expected_mergeinfo_output = wc.State(A_COPY_path, {
+    ''  : Item(status=' U'),
+    'B' : Item(status=' U'),
+    })
+  expected_elision_output = wc.State(A_COPY_path, {
+    'B' : Item(status=' U'),
+    })
+  expected_status = wc.State(A_COPY_path, {
+    ''           : Item(status=' M'),
+    'B'          : Item(status=' M'),
+    'mu'         : Item(status='  '),
+    'B/E'        : Item(status='  '),
+    'B/E/alpha'  : Item(status='  '),
+    'B/E/beta'   : Item(status='M '),
+    'B/lambda'   : Item(status='  '),
+    'B/F'        : Item(status='  '),
+    'C'          : Item(status='  '),
+    'D'          : Item(status='  '),
+    'D/G'        : Item(status='  '),
+    'D/G/pi'     : Item(status='  '),
+    'D/G/rho'    : Item(status='  '),
+    'D/G/tau'    : Item(status='  '),
+    'D/gamma'    : Item(status='  '),
+    'D/H'        : Item(status='  '),
+    'D/H/chi'    : Item(status='  '),
+    'D/H/psi'    : Item(status='  '),
+    'D/H/omega'  : Item(status='  '),
+    })
+  expected_status.tweak(wc_rev='7')
+  expected_disk = wc.State('', {
+    ''           : Item(props={SVN_PROP_MERGEINFO : '/A:2-7'}),
+    'B'          : Item(),
+    'mu'         : Item("This is the file 'mu'.\n"),
+    'B/E'        : Item(),
+    'B/E/alpha'  : Item("This is the file 'alpha'.\n"),
+    'B/E/beta'   : Item("New content"),
+    'B/lambda'   : Item("This is the file 'lambda'.\n"),
+    'B/F'        : Item(),
+    'C'          : Item(),
+    'D'          : Item(),
+    'D/G'        : Item(),
+    'D/G/pi'     : Item("This is the file 'pi'.\n"),
+    'D/G/rho'    : Item("New content"),
+    'D/G/tau'    : Item("This is the file 'tau'.\n"),
+    'D/gamma'    : Item("This is the file 'gamma'.\n"),
+    'D/H'        : Item(),
+    'D/H/chi'    : Item("This is the file 'chi'.\n"),
+    'D/H/psi'    : Item("New content"),
+    'D/H/omega'  : Item("New content"),
+    })
+  expected_skip = wc.State(A_COPY_path, { })
+  svntest.actions.run_and_verify_merge(A_COPY_path, None, None,
+                                       sbox.repo_url + '/A', None,
+                                       expected_output,
+                                       expected_mergeinfo_output,
+                                       expected_elision_output,
+                                       expected_disk,
+                                       expected_status,
+                                       expected_skip,
+                                       None, None, None, None,
+                                       None, 1, 0, '--symmetric', A_COPY_path)
+
 ########################################################################
 # Run the tests
 
@@ -760,6 +1009,8 @@ test_list = [ None,
               cherry1_fwd,
               cherry2_fwd,
               cherry3_fwd,
+              subtree_to_and_fro,
+              merge_to_reverse_cherry_subtree_to_merge_to,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py Wed Jul 11 10:26:19 2012
@@ -50,7 +50,8 @@ from svntest.actions import inject_confl
 
 def expected_merge_output(rev_ranges, additional_lines=None, foreign=False,
                           elides=False, two_url=False, target=None,
-                          text_conflicts=0, prop_conflicts=0, tree_conflicts=0):
+                          text_conflicts=0, prop_conflicts=0, tree_conflicts=0,
+                          resolved=[]):
   """Generate an (inefficient) regex representing the expected merge
   output and mergeinfo notifications from REV_RANGES and ADDITIONAL_LINES.
 
@@ -72,7 +73,10 @@ def expected_merge_output(rev_ranges, ad
   notifications; if None, it is not checked.
 
   TEXT_CONFLICTS, PROP_CONFLICTS and TREE_CONFLICTS specify the number of
-  each kind of conflict to expect."""
+  each kind of conflict to expect.
+
+  RESOLVED contains a list of target paths of which conflicts are resolved
+  during merging"""
 
   if rev_ranges is None:
     lines = [svntest.main.merge_notify_line(None, None, False, foreign)]
@@ -111,6 +115,9 @@ def expected_merge_output(rev_ranges, ad
       additional_lines = additional_lines.replace("\\", "\\\\")
     lines.append(str(additional_lines))
 
+  for rslv in resolved:
+    lines.append("Resolved conflicted state of '%s'" % re.escape(rslv))
+
   if text_conflicts or prop_conflicts or tree_conflicts:
     lines.append("Summary of conflicts:\n")
     if text_conflicts:
@@ -12532,7 +12539,8 @@ def svn_copy(s_rev, path1, path2):
                                      '-r', s_rev, path1, path2)
 
 def svn_merge(rev_range, source, target, lines=None, elides=[],
-              text_conflicts=0, prop_conflicts=0, tree_conflicts=0, args=[]):
+              text_conflicts=0, prop_conflicts=0, tree_conflicts=0, args=[],
+              resolved=[]):
   """Merge a single change from path SOURCE to path TARGET and verify the
   output and that there is no error.  (The changes made are not verified.)
 
@@ -12547,7 +12555,10 @@ def svn_merge(rev_range, source, target,
   TEXT_CONFLICTS, PROP_CONFLICTS and TREE_CONFLICTS specify the number of
   each kind of conflict to expect.
 
-  ARGS are additional arguments passed to svn merge."""
+  ARGS are additional arguments passed to svn merge.
+
+  RESOLVED contains a list of targets of which conflicts are resolved
+  during merging"""
 
   source = local_path(source)
   target = local_path(target)
@@ -12568,7 +12579,8 @@ def svn_merge(rev_range, source, target,
                                   elides=elides,
                                   text_conflicts=text_conflicts,
                                   prop_conflicts=prop_conflicts,
-                                  tree_conflicts=tree_conflicts)
+                                  tree_conflicts=tree_conflicts,
+                                  resolved=resolved)
   svntest.actions.run_and_verify_svn(None, exp_out, [],
                                      'merge', rev_arg, source, target, *args)
 
@@ -13110,7 +13122,10 @@ def merge_two_edits_to_same_prop(sbox):
   # Merge the first change, then the second, to source.
   svn_merge(rev3, A_COPY_path, A_path, [
       " C   %s\n" % mu_path,
-      ], prop_conflicts=1, args=['--allow-mixed-revisions'])
+      ], prop_conflicts=1,
+      args=['--allow-mixed-revisions',
+            '--accept=theirs-conflict'],
+      resolved=[mu_path])
   svn_merge(rev4, A_COPY_path, A_path, [
       " C   %s\n" % mu_path,
       ], prop_conflicts=1, args=['--allow-mixed-revisions'])
@@ -15216,7 +15231,7 @@ def merge_automatic_conflict_resolution(
                                      'revert', '--recursive', wc_dir)
 
   # Test --accept mine-conflict and mine-full
-  expected_output = wc.State(A_COPY_path, {'D/H/psi' : Item(status='U ')})
+  expected_output = wc.State(A_COPY_path, {'D/H/psi' : Item(status='C ')})
   expected_disk.tweak('D/H/psi', contents="BASE.\n")
   expected_status.tweak('D/H/psi', status='  ')
   svntest.actions.run_and_verify_merge(A_COPY_path, '2', '3',
@@ -15251,7 +15266,7 @@ def merge_automatic_conflict_resolution(
                                      'revert', '--recursive', wc_dir)
 
   # Test --accept theirs-conflict and theirs-full
-  expected_output = wc.State(A_COPY_path, {'D/H/psi' : Item(status='U ')})
+  expected_output = wc.State(A_COPY_path, {'D/H/psi' : Item(status='C ')})
   expected_disk.tweak('D/H/psi', contents="New content")
   expected_status.tweak('D/H/psi', status='M ')
   svntest.actions.run_and_verify_merge(A_COPY_path, '2', '3',
@@ -15285,7 +15300,7 @@ def merge_automatic_conflict_resolution(
   svntest.actions.run_and_verify_svn(None, None, [],
                                      'revert', '--recursive', wc_dir)
   # Test --accept base
-  expected_output = wc.State(A_COPY_path, {'D/H/psi' : Item(status='U ')})
+  expected_output = wc.State(A_COPY_path, {'D/H/psi' : Item(status='C ')})
   expected_elision_output = wc.State(A_COPY_path, {
     })
   expected_disk.tweak('D/H/psi', contents="This is the file 'psi'.\n")

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/merge_tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/merge_tree_conflict_tests.py?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/merge_tree_conflict_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/merge_tree_conflict_tests.py Wed Jul 11 10:26:19 2012
@@ -1738,8 +1738,7 @@ def merge_replace_causes_tree_conflict(s
   expected_status.tweak('A', status=' M')
   expected_status.tweak('A/D/G/pi', 'A/mu', status='M ', treeconflict='C')
   expected_status.tweak('A/D/H', status=' M', treeconflict='C')
-  ### A/B/E gets both a property and tree conflict flagged. Is this OK?
-  expected_status.tweak('A/B/E', status=' C', treeconflict='C')
+  expected_status.tweak('A/B/E', status=' M', treeconflict='C')
 
   actions.run_and_verify_status(wc_dir, expected_status)
 

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/special_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/special_tests.py?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/special_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/special_tests.py Wed Jul 11 10:26:19 2012
@@ -948,6 +948,32 @@ def replace_symlinks(sbox):
       os.chmod(wc(p), 0775)
       sbox.simple_add(p)
   sbox.simple_commit() # r2
+  sbox.simple_update()
+  expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 2)
+  expected_status.add({
+    'A/D/Y'         : Item(status='  ', wc_rev=2),
+    'A/D/G/Z'       : Item(status='  ', wc_rev=2),
+    'A/D/G/rho.sh'  : Item(status='  ', wc_rev=2),
+    'A/D/Hx'        : Item(status='  ', wc_rev=2),
+    'A/D/Hx/Z'      : Item(status='  ', wc_rev=2),
+    'A/D/Hx/chi'    : Item(status='  ', wc_rev=2),
+    'A/D/Hx/psi.sh' : Item(status='  ', wc_rev=2),
+    'A/D/H/psi.sh'  : Item(status='  ', wc_rev=2),
+    'A/D/H/Z'       : Item(status='  ', wc_rev=2),
+    'A/D/Gx'        : Item(status='  ', wc_rev=2),
+    'A/D/Gx/Z'      : Item(status='  ', wc_rev=2),
+    'A/D/Gx/pi'     : Item(status='  ', wc_rev=2),
+    'A/D/Gx/rho.sh' : Item(status='  ', wc_rev=2),
+    'A/D/gamma.sh'  : Item(status='  ', wc_rev=2),
+    'A/B/E/beta.sh' : Item(status='  ', wc_rev=2),
+    'Ax'            : Item(status='  ', wc_rev=2),
+    'Ax/mu'         : Item(status='  ', wc_rev=2),
+    'Ax/mu.sh'      : Item(status='  ', wc_rev=2),
+    'A/mu.sh'       : Item(status='  ', wc_rev=2),
+    'iota.sh'       : Item(status='  ', wc_rev=2),
+    })
+  expected_status_r2 = expected_status
+  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status_r2)
 
   # Failing git-svn test: 'new symlink is added to a file that was
   # also just made executable', i.e., in the same revision.
@@ -1011,14 +1037,38 @@ def replace_symlinks(sbox):
   ### TODO Replace a normal {file, exec, dir, dir} with a symlink to
   ### {dir, dir, file, exec}.  And the same symlink-to-normal.
 
-  ### Commit fails as of r1226697 with either "svn: E145001: Entry
-  ### '.../A/D/Gx/Z' has unexpectedly changed special status" or "svn:
-  ### E155010: The node '.../Ax/mu' was not found".
+  expected_status.tweak('A/D/G/pi',
+                        'A/D/G/rho.sh',
+                        'A/D/H/psi.sh',
+                        'A/D/H/chi',
+                        'A/mu',
+                        'A/mu.sh',
+                        status='RM')
+  expected_status.tweak('A/B/E/beta.sh',
+                        'A/B/E/alpha',
+                        status=' M')
+  expected_status.tweak('Ax/mu',
+                        'Ax/mu.sh',
+                        status='MM')
+  expected_status.add({
+      'A/B/E/sym-alpha'   : Item(status='A ', wc_rev=0),
+      'A/B/E/sym-beta.sh' : Item(status='A ', wc_rev=0),
+      })
+  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
   sbox.simple_commit() # r3
+  sbox.simple_update()
+
+  expected_status.tweak(status='  ', wc_rev=3)
+  expected_status_r3 = expected_status
+  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status_r3)
 
-  # Try updating from HEAD-1 to HEAD.
+  # Try updating from HEAD-1 to HEAD.  This is currently XFAIL as the
+  # update to HEAD-1 produces a tree conflict.
   run_svn(None, 'up', '-r2', sbox.wc_dir)
+  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status_r2)
   sbox.simple_update()
+  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status_r3)
 
 
 @Issue(4102)

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py Wed Jul 11 10:26:19 2012
@@ -184,11 +184,12 @@ def get_txns(repo_dir):
   return txns
 
 def load_and_verify_dumpstream(sbox, expected_stdout, expected_stderr,
-                               revs, dump, *varargs):
-  """Load the array of lines passed in 'dump' into the
-  current tests' repository and verify the repository content
-  using the array of wc.States passed in revs. VARARGS are optional
-  arguments passed to the 'load' command"""
+                               revs, check_props, dump, *varargs):
+  """Load the array of lines passed in DUMP into the current tests'
+  repository and verify the repository content using the array of
+  wc.States passed in REVS.  If CHECK_PROPS is True, check properties
+  of each rev's items.  VARARGS are optional arguments passed to the
+  'load' command."""
 
   if isinstance(dump, str):
     dump = [ dump ]
@@ -223,7 +224,7 @@ def load_and_verify_dumpstream(sbox, exp
                                          "update", "-r%s" % (rev+1),
                                          sbox.wc_dir)
 
-      wc_tree = svntest.tree.build_tree_from_wc(sbox.wc_dir)
+      wc_tree = svntest.tree.build_tree_from_wc(sbox.wc_dir, check_props)
       rev_tree = revs[rev].old_tree()
 
       try:
@@ -232,6 +233,10 @@ def load_and_verify_dumpstream(sbox, exp
         svntest.verify.display_trees(None, 'WC TREE', wc_tree, rev_tree)
         raise
 
+def load_dumpstream(sbox, dump, *varargs):
+  "Load dump text without verification."
+  return load_and_verify_dumpstream(sbox, None, None, None, False, dump,
+                                    *varargs)
 
 ######################################################################
 # Tests
@@ -308,7 +313,7 @@ def extra_headers(sbox):
   dumpfile[3:3] = \
        [ "X-Comment-Header: Ignored header normally not in dump stream\n" ]
 
-  load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile,
+  load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, False, dumpfile,
                              '--ignore-uuid')
 
 #----------------------------------------------------------------------
@@ -327,7 +332,7 @@ def extra_blockcontent(sbox):
   # Insert the extra content after "PROPS-END\n"
   dumpfile[11] = dumpfile[11][:-2] + "extra text\n\n\n"
 
-  load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile,
+  load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, False, dumpfile,
                              '--ignore-uuid')
 
 #----------------------------------------------------------------------
@@ -341,7 +346,7 @@ def inconsistent_headers(sbox):
   dumpfile[-2] = "Content-length: 30\n\n"
 
   load_and_verify_dumpstream(sbox, [], svntest.verify.AnyOutput,
-                             dumpfile_revisions, dumpfile)
+                             dumpfile_revisions, False, dumpfile)
 
 #----------------------------------------------------------------------
 # Test for issue #2729: Datestamp-less revisions in dump streams do
@@ -361,7 +366,7 @@ def empty_date(sbox):
          "K 7\nsvn:log\nV 0\n\nK 10\nsvn:author\nV 4\nerik\nPROPS-END\n\n\n"
          ]
 
-  load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile,
+  load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, False, dumpfile,
                              '--ignore-uuid')
 
   # Verify that the revision still lacks the svn:date property.
@@ -808,8 +813,7 @@ def load_with_parent_dir(sbox):
                                      ['\n', 'Committed revision 1.\n'],
                                      [], "mkdir", sbox.repo_url + "/sample",
                                      "-m", "Create sample dir")
-  load_and_verify_dumpstream(sbox, [], [], None, dumpfile, '--parent-dir',
-                             '/sample')
+  load_dumpstream(sbox, dumpfile, '--parent-dir', '/sample')
 
   # Verify the svn:mergeinfo properties for '--parent-dir'
   svntest.actions.run_and_verify_svn(None,
@@ -831,8 +835,7 @@ def load_with_parent_dir(sbox):
                                      ['\n', 'Committed revision 11.\n'],
                                      [], "mkdir", sbox.repo_url + "/sample-2",
                                      "-m", "Create sample-2 dir")
-  load_and_verify_dumpstream(sbox, [], [], None, dumpfile, '--parent-dir',
-                             'sample-2')
+  load_dumpstream(sbox, dumpfile, '--parent-dir', 'sample-2')
 
   # Verify the svn:mergeinfo properties for '--parent-dir'.
   svntest.actions.run_and_verify_svn(None,
@@ -907,11 +910,10 @@ def reflect_dropped_renumbered_revs(sbox
                                      "-m", "Create toplevel dir")
 
   # Load the dump stream in sbox.repo_url
-  load_and_verify_dumpstream(sbox,[],[], None, dumpfile)
+  load_dumpstream(sbox, dumpfile)
 
   # Load the dump stream in toplevel dir
-  load_and_verify_dumpstream(sbox,[],[], None, dumpfile, '--parent-dir',
-                             '/toplevel')
+  load_dumpstream(sbox, dumpfile, '--parent-dir', '/toplevel')
 
   # Verify the svn:mergeinfo properties
   url = sbox.repo_url
@@ -1142,7 +1144,7 @@ def dont_drop_valid_mergeinfo_during_inc
   dumpfile_full = open(os.path.join(os.path.dirname(sys.argv[0]),
                                     'svnadmin_tests_data',
                                     'mergeinfo_included_full.dump')).read()
-  load_and_verify_dumpstream(sbox, [], [], None, dumpfile_full, '--ignore-uuid')
+  load_dumpstream(sbox, dumpfile_full, '--ignore-uuid')
 
   # Check that the mergeinfo is as expected.
   url = sbox.repo_url + '/branches/'
@@ -1184,15 +1186,9 @@ def dont_drop_valid_mergeinfo_during_inc
   test_create(sbox)
 
   # Load the three incremental dump files in sequence.
-  load_and_verify_dumpstream(sbox, [], [], None,
-                             open(dump_file_r1_10).read(),
-                             '--ignore-uuid')
-  load_and_verify_dumpstream(sbox, [], [], None,
-                             open(dump_file_r11_13).read(),
-                             '--ignore-uuid')
-  load_and_verify_dumpstream(sbox, [], [], None,
-                             open(dump_file_r14_15).read(),
-                             '--ignore-uuid')
+  load_dumpstream(sbox, open(dump_file_r1_10).read(), '--ignore-uuid')
+  load_dumpstream(sbox, open(dump_file_r11_13).read(), '--ignore-uuid')
+  load_dumpstream(sbox, open(dump_file_r14_15).read(), '--ignore-uuid')
 
   # Check the mergeinfo, we use the same expected output as before,
   # as it (duh!) should be exactly the same as when we loaded the
@@ -1221,13 +1217,11 @@ def dont_drop_valid_mergeinfo_during_inc
   dumpfile_skeleton = open(os.path.join(os.path.dirname(sys.argv[0]),
                                         'svnadmin_tests_data',
                                         'skeleton_repos.dump')).read()
-  load_and_verify_dumpstream(sbox, [], [], None, dumpfile_skeleton,
-                             '--ignore-uuid')
+  load_dumpstream(sbox, dumpfile_skeleton, '--ignore-uuid')
 
   # Load 'svnadmin_tests_data/mergeinfo_included_full.dump' in one shot:
-  load_and_verify_dumpstream(sbox, [], [], None, dumpfile_full,
-                             '--parent-dir', 'Projects/Project-X',
-                             '--ignore-uuid')
+  load_dumpstream(sbox, dumpfile_full, '--parent-dir', 'Projects/Project-X',
+                  '--ignore-uuid')
 
   # Check that the mergeinfo is as expected.  This is exactly the
   # same expected mergeinfo we previously checked, except that the
@@ -1263,22 +1257,15 @@ def dont_drop_valid_mergeinfo_during_inc
   test_create(sbox)
 
   # Load this skeleton repos into the empty target:
-  load_and_verify_dumpstream(sbox, [], [], None, dumpfile_skeleton,
-                             '--ignore-uuid')
+  load_dumpstream(sbox, dumpfile_skeleton, '--ignore-uuid')
 
   # Load the three incremental dump files in sequence.
-  load_and_verify_dumpstream(sbox, [], [], None,
-                             open(dump_file_r1_10).read(),
-                             '--parent-dir', 'Projects/Project-X',
-                             '--ignore-uuid')
-  load_and_verify_dumpstream(sbox, [], [], None,
-                             open(dump_file_r11_13).read(),
-                             '--parent-dir', 'Projects/Project-X',
-                             '--ignore-uuid')
-  load_and_verify_dumpstream(sbox, [], [], None,
-                             open(dump_file_r14_15).read(),
-                             '--parent-dir', 'Projects/Project-X',
-                             '--ignore-uuid')
+  load_dumpstream(sbox, open(dump_file_r1_10).read(),
+                  '--parent-dir', 'Projects/Project-X', '--ignore-uuid')
+  load_dumpstream(sbox, open(dump_file_r11_13).read(),
+                  '--parent-dir', 'Projects/Project-X', '--ignore-uuid')
+  load_dumpstream(sbox, open(dump_file_r14_15).read(),
+                  '--parent-dir', 'Projects/Project-X', '--ignore-uuid')
 
   # Check the resulting mergeinfo.  We expect the exact same results
   # as Part 3.
@@ -1402,7 +1389,7 @@ text
 
   # Try to load the dumpstream, expecting a failure (because of mixed EOLs).
   load_and_verify_dumpstream(sbox, [], svntest.verify.AnyOutput,
-                             dumpfile_revisions, dump_str,
+                             dumpfile_revisions, False, dump_str,
                              '--ignore-uuid')
 
   # Now try it again bypassing prop validation.  (This interface takes
@@ -1423,8 +1410,8 @@ def verify_non_utf8_paths(sbox):
   test_create(sbox)
 
   # Load the dumpstream
-  load_and_verify_dumpstream(sbox, [], [], dumpfile_revisions, dumpfile,
-                             '--ignore-uuid')
+  load_and_verify_dumpstream(sbox, [], [], dumpfile_revisions, False,
+                             dumpfile, '--ignore-uuid')
 
   # Replace the path 'A' in revision 1 with a non-UTF-8 sequence.
   # This has been observed in repositories in the wild, though Subversion
@@ -1590,13 +1577,13 @@ def load_ranges(sbox):
 
   # Load our dumpfile, 2 revisions at a time, verifying that we have
   # the correct youngest revision after each load.
-  load_and_verify_dumpstream(sbox, [], [], None, dumpdata, '-r0:2')
+  load_dumpstream(sbox, dumpdata, '-r0:2')
   svntest.actions.run_and_verify_svnlook("Unexpected output", ['2\n'],
                                          None, 'youngest', sbox.repo_dir)
-  load_and_verify_dumpstream(sbox, [], [], None, dumpdata, '-r3:4')
+  load_dumpstream(sbox, dumpdata, '-r3:4')
   svntest.actions.run_and_verify_svnlook("Unexpected output", ['4\n'],
                                          None, 'youngest', sbox.repo_dir)
-  load_and_verify_dumpstream(sbox, [], [], None, dumpdata, '-r5:6')
+  load_dumpstream(sbox, dumpdata, '-r5:6')
   svntest.actions.run_and_verify_svnlook("Unexpected output", ['6\n'],
                                          None, 'youngest', sbox.repo_dir)
 

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svndumpfilter_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svndumpfilter_tests.py?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svndumpfilter_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svndumpfilter_tests.py Wed Jul 11 10:26:19 2012
@@ -33,8 +33,10 @@ import tempfile
 import svntest
 from svntest.verify import SVNExpectedStdout, SVNExpectedStderr
 
-# Get some helper routines from svnadmin_tests
-from svnadmin_tests import load_and_verify_dumpstream, test_create
+# Get some helper routines
+from svnadmin_tests import (load_and_verify_dumpstream, load_dumpstream,
+                            test_create)
+from svntest.main import run_svn, run_svnadmin
 
 # (abbreviation)
 Skip = svntest.testcase.Skip_deco
@@ -103,8 +105,7 @@ def reflect_dropped_renumbered_revs(sbox
       "--drop-empty-revs",
       "--renumber-revs", "--quiet")
 
-  load_and_verify_dumpstream(sbox, [], [], None, filtered_out,
-                             "--ignore-uuid")
+  load_dumpstream(sbox, filtered_out, "--ignore-uuid")
 
   # Verify the svn:mergeinfo properties
   url = sbox.repo_url
@@ -124,8 +125,7 @@ def reflect_dropped_renumbered_revs(sbox
       "--drop-empty-revs",
       "--renumber-revs", "--quiet")
 
-  load_and_verify_dumpstream(sbox, [], [], None, filtered_out,
-                             "--ignore-uuid")
+  load_dumpstream(sbox, filtered_out, "--ignore-uuid")
 
   # Verify the svn:mergeinfo properties
   expected_output = svntest.verify.UnorderedOutput([
@@ -151,7 +151,7 @@ def svndumpfilter_loses_mergeinfo(sbox):
   filtered_out, filtered_err = filter_and_return_output(dumpfile, 0, "include",
                                                         "trunk", "branch1",
                                                         "--quiet")
-  load_and_verify_dumpstream(sbox, [], [], None, filtered_out)
+  load_dumpstream(sbox, filtered_out)
 
   # Verify the svn:mergeinfo properties
   url = sbox.repo_url
@@ -174,8 +174,7 @@ def _simple_dumpfilter_test(sbox, dumpfi
                                                            *dumpargs)
 
   # Setup our expectations
-  load_and_verify_dumpstream(sbox, [], [], None, filtered_output,
-                             '--ignore-uuid')
+  load_dumpstream(sbox, filtered_output, '--ignore-uuid')
   expected_disk = svntest.main.greek_state.copy()
   expected_disk.remove('A/B/E/alpha')
   expected_disk.remove('A/B/E/beta')
@@ -349,8 +348,7 @@ def filter_mergeinfo_revs_outside_of_dum
       "include", "trunk", "branches",
       "--skip-missing-merge-sources",
       "--quiet")
-  load_and_verify_dumpstream(sbox, [], [], None, filtered_dumpfile2,
-                             '--ignore-uuid')
+  load_dumpstream(sbox, filtered_dumpfile2, '--ignore-uuid')
   # Check the resulting mergeinfo.
   url = sbox.repo_url + "/branches"
   expected_output = svntest.verify.UnorderedOutput([
@@ -377,8 +375,7 @@ def filter_mergeinfo_revs_outside_of_dum
   skeleton_dumpfile = open(os.path.join(os.path.dirname(sys.argv[0]),
                                         'svnadmin_tests_data',
                                         'skeleton_repos.dump')).read()
-  load_and_verify_dumpstream(sbox, [], [], None, skeleton_dumpfile,
-                             '--ignore-uuid')
+  load_dumpstream(sbox, skeleton_dumpfile, '--ignore-uuid')
   partial_dump2 = os.path.join(os.path.dirname(sys.argv[0]),
                                    'svndumpfilter_tests_data',
                                    'mergeinfo_included_partial.dump')
@@ -480,9 +477,8 @@ def filter_mergeinfo_revs_outside_of_dum
 
   # Now actually load the filtered dump into the skeleton repository
   # and then check the resulting mergeinfo.
-  load_and_verify_dumpstream(sbox, [], [], None, filtered_dumpfile2,
-                             '--parent-dir', '/Projects/Project-X',
-                             '--ignore-uuid')
+  load_dumpstream(sbox, filtered_dumpfile2,
+                  '--parent-dir', '/Projects/Project-X', '--ignore-uuid')
 
   url = sbox.repo_url + "/Projects/Project-X/branches"
   expected_output = svntest.verify.UnorderedOutput([
@@ -568,8 +564,7 @@ def dropped_but_not_renumbered_empty_rev
       "--skip-missing-merge-sources", "--drop-empty-revs")
 
   # Now load the filtered dump into an empty repository.
-  load_and_verify_dumpstream(sbox, [], [], None, filtered_dumpfile,
-                             '--ignore-uuid')
+  load_dumpstream(sbox, filtered_dumpfile, '--ignore-uuid')
 
   # The mergeinfo in the newly loaded repos should have no references to the
   # dropped branch and the remaining merge source revs should be remapped to
@@ -622,8 +617,7 @@ def match_empty_prefix(sbox):
 
     # Load the filtered dump into a repo and check the result
     test_create(sbox)
-    load_and_verify_dumpstream(sbox, [], [], None, filtered_output,
-                               '--ignore-uuid')
+    load_dumpstream(sbox, filtered_output, '--ignore-uuid')
     svntest.actions.run_and_verify_update(sbox.wc_dir,
                                           expected_output,
                                           expected_disk,
@@ -651,6 +645,40 @@ def match_empty_prefix(sbox):
   # doesn't seem to be a consistent way to quote such an argument to
   # prevent expansion.
 
+@Issue(2760)
+def accepts_deltas(sbox):
+  "accepts deltas in the input"
+  # Accept format v3 (as created by 'svnadmin --deltas' or svnrdump).
+
+  test_create(sbox)
+  dumpfile_location = os.path.join(os.path.dirname(sys.argv[0]),
+                                   'svndumpfilter_tests_data',
+                                   'simple_v3.dump')
+  dump_in = open(dumpfile_location).read()
+
+  dump_out, err = filter_and_return_output(dump_in, 0, "include",
+                                                        "trunk", "--quiet")
+
+  expected_revs = [
+    svntest.wc.State('', {
+      'trunk'     : svntest.wc.StateItem(props={'soup': 'No soup for you!'}),
+      'trunk/foo' : svntest.wc.StateItem("This is file 'foo'.\n"),
+      }),
+    svntest.wc.State('', {
+      'trunk'     : svntest.wc.StateItem(props={'soup': 'No soup for you!'}),
+      'trunk/foo' : svntest.wc.StateItem("This is file 'foo'.\n"),
+      }),
+    svntest.wc.State('', {
+      'trunk'     : svntest.wc.StateItem(props={'story': 'Yada yada yada...'}),
+      'trunk/foo' : svntest.wc.StateItem("This is file 'foo'.\n"),
+      }),
+    ]
+
+  load_and_verify_dumpstream(sbox, [], [], expected_revs, True, dump_out,
+                             '--ignore-uuid')
+
+  
+
 ########################################################################
 # Run the tests
 
@@ -664,6 +692,7 @@ test_list = [ None,
               filter_mergeinfo_revs_outside_of_dump_stream,
               dropped_but_not_renumbered_empty_revs,
               match_empty_prefix,
+              accepts_deltas,
               ]
 
 if __name__ == '__main__':

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svnlook_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svnlook_tests.py?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svnlook_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svnlook_tests.py Wed Jul 11 10:26:19 2012
@@ -643,7 +643,7 @@ svnlook_bin=%s
 fp = open(os.path.join(sys.argv[1], 'hooks.log'), 'wb')
 def output_command(fp, cmd, opt):
   command = [svnlook_bin, cmd, '-t', sys.argv[2], sys.argv[1]] + opt
-  process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False)
+  process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False, bufsize=-1)
   (output, errors) = process.communicate()
   status = process.returncode
   fp.write(output)

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svntest/actions.py?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svntest/actions.py Wed Jul 11 10:26:19 2012
@@ -1869,7 +1869,7 @@ def enable_revprop_changes(repo_dir):
 
   hook_path = main.get_pre_revprop_change_hook_path(repo_dir)
   main.create_python_hook_script(hook_path, 'import sys; sys.exit(0)',
-                                 cmd_alternative='@exit /b 0')
+                                 cmd_alternative='@exit 0')
 
 def disable_revprop_changes(repo_dir):
   """Disable revprop changes in the repository at REPO_DIR by creating a
@@ -1884,7 +1884,7 @@ def disable_revprop_changes(repo_dir):
                                  'sys.exit(1)\n',
                                  cmd_alternative=
                                        '@echo pre-revprop-change %* 1>&2\n'
-                                       '@exit /b 1\n')
+                                       '@exit 1\n')
 
 def create_failing_post_commit_hook(repo_dir):
   """Create a post-commit hook script in the repository at REPO_DIR that always
@@ -1896,7 +1896,7 @@ def create_failing_post_commit_hook(repo
     'sys.exit(1)\n',
     cmd_alternative=
             '@echo Post-commit hook failed 1>&2\n'
-            '@exit /b 1\n')
+            '@exit 1\n')
 
 # set_prop can be used for properties with NULL characters which are not
 # handled correctly when passed to subprocess.Popen() and values like "*"

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py Wed Jul 11 10:26:19 2012
@@ -35,6 +35,8 @@ import optparse
 import xml
 import urllib
 import logging
+import hashlib
+from urlparse import urlparse
 
 try:
   # Python >=3.0
@@ -369,7 +371,7 @@ def _quote_arg(arg):
     # Quoting suitable for most Unix shells.
     return "'" + arg.replace("'", "'\\''") + "'"
 
-def open_pipe(command, bufsize=0, stdin=None, stdout=None, stderr=None):
+def open_pipe(command, bufsize=-1, stdin=None, stdout=None, stderr=None):
   """Opens a subprocess.Popen pipe to COMMAND using STDIN,
   STDOUT, and STDERR.  BUFSIZE is passed to subprocess.Popen's
   argument of the same name.
@@ -442,7 +444,7 @@ def wait_on_pipe(waiter, binary_mode, st
       logger.info("CMD: %s exited with %d" % (command_string, exit_code))
     return stdout_lines, stderr_lines, exit_code
 
-def spawn_process(command, bufsize=0, binary_mode=0, stdin_lines=None,
+def spawn_process(command, bufsize=-1, binary_mode=0, stdin_lines=None,
                   *varargs):
   """Run any binary, supplying input text, logging the command line.
   BUFSIZE dictates the pipe buffer size used in communication with the
@@ -475,7 +477,7 @@ def spawn_process(command, bufsize=0, bi
 
   return exit_code, stdout_lines, stderr_lines
 
-def run_command_stdin(command, error_expected, bufsize=0, binary_mode=0,
+def run_command_stdin(command, error_expected, bufsize=-1, binary_mode=0,
                       stdin_lines=None, *varargs):
   """Run COMMAND with VARARGS; input STDIN_LINES (a list of strings
   which should include newline characters) to program via stdin - this
@@ -532,7 +534,8 @@ def run_command_stdin(command, error_exp
          [line for line in stdout_lines if not line.startswith("DBG:")], \
          stderr_lines
 
-def create_config_dir(cfgdir, config_contents=None, server_contents=None):
+def create_config_dir(cfgdir, config_contents=None, server_contents=None,
+                      ssl_cert=None, ssl_url=None):
   "Create config directories and files"
 
   # config file names
@@ -570,6 +573,56 @@ store-passwords=yes
   file_write(cfgfile_cfg, config_contents)
   file_write(cfgfile_srv, server_contents)
 
+  if (ssl_cert and ssl_url):
+    trust_ssl_cert(cfgdir, ssl_cert, ssl_url)
+  elif cfgdir != default_config_dir:
+    copy_trust(cfgdir, default_config_dir)
+
+
+def trust_ssl_cert(cfgdir, ssl_cert, ssl_url):
+  """Setup config dir to trust the given ssl_cert for the given ssl_url
+  """
+
+  cert_rep = ''
+  fp = open(ssl_cert, 'r')
+  for line in fp.readlines()[1:-1]:
+    cert_rep = cert_rep + line.strip()
+
+  parsed_url = urlparse(ssl_url)
+  netloc_url = '%s://%s' % (parsed_url.scheme, parsed_url.netloc)
+  ssl_dir = os.path.join(cfgdir, 'auth', 'svn.ssl.server')
+  if not os.path.isdir(ssl_dir):
+    os.makedirs(ssl_dir)
+  md5_name = hashlib.md5(netloc_url).hexdigest()
+  md5_file = os.path.join(ssl_dir, md5_name)
+  md5_file_contents = """K 10
+ascii_cert
+V %d
+%s
+K 8
+failures
+V 1
+8
+K 15
+svn:realmstring
+V %d
+%s
+END
+""" % (len(cert_rep), cert_rep, len(netloc_url), netloc_url)
+
+  file_write(md5_file, md5_file_contents)
+
+def copy_trust(dst_cfgdir, src_cfgdir):
+  """Copy svn.ssl.server files from one config dir to another.
+  """
+
+  src_ssl_dir = os.path.join(src_cfgdir, 'auth', 'svn.ssl.server')
+  dst_ssl_dir = os.path.join(dst_cfgdir, 'auth', 'svn.ssl.server')
+  if not os.path.isdir(dst_ssl_dir):
+    os.makedirs(dst_ssl_dir)
+  for f in os.listdir(src_ssl_dir):
+    shutil.copy(os.path.join(src_ssl_dir, f), os.path.join(dst_ssl_dir, f))
+
 def _with_config_dir(args):
   if '--config-dir' in args:
     return args
@@ -676,7 +729,7 @@ def run_atomic_ra_revprop_change(url, re
   # This passes HTTP_LIBRARY in addition to our params.
   return run_command(atomic_ra_revprop_change_binary, True, False,
                      url, revision, propname, skel,
-                     options.http_library, want_error and 1 or 0)
+                     want_error and 1 or 0, default_config_dir)
 
 def run_wc_lock_tester(recursive, path):
   "Run the wc-lock obtainer tool, returning its exit code, stdout and stderr"
@@ -1215,6 +1268,8 @@ class TestSpawningThread(threading.Threa
       args.append('--mode-filter=' + options.mode_filter)
     if options.milestone_filter:
       args.append('--milestone-filter=' + options.milestone_filter)
+    if options.ssl_cert:
+      args.append('--ssl-cert=' + options.ssl_cert)
 
     result, stdout_lines, stderr_lines = spawn_process(command, 0, 0, None,
                                                        *args)
@@ -1561,6 +1616,8 @@ def _create_parser():
                          'useful during test development!')
   parser.add_option('--srcdir', action='store', dest='srcdir',
                     help='Source directory.')
+  parser.add_option('--ssl-cert', action='store',
+                    help='Path to SSL server certificate.')
 
   # most of the defaults are None, but some are other values, set them here
   parser.set_defaults(
@@ -1861,7 +1918,9 @@ def execute_tests(test_list, serial_only
 
   if not options.is_child_process:
     # Build out the default configuration directory
-    create_config_dir(default_config_dir)
+    create_config_dir(default_config_dir,
+                      ssl_cert=options.ssl_cert,
+                      ssl_url=options.test_area_url)
 
     # Setup the pristine repository
     svntest.actions.setup_pristine_greek_repository()

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/switch_tests.py?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/switch_tests.py Wed Jul 11 10:26:19 2012
@@ -2445,7 +2445,7 @@ def tree_conflicts_on_switch_1_2(sbox):
       'Tree conflict' :
         '^local delete, incoming delete upon switch'
         + ' Source  left: .file.*/F/alpha@2'
-        + ' Source right: .none.*/F/alpha@3$',
+        + ' Source right: .none.*(/F/alpha@3)?$',
     },
     'DF/D1' : {
       'Tree conflict' :
@@ -2463,7 +2463,7 @@ def tree_conflicts_on_switch_1_2(sbox):
       'Tree conflict' :
         '^local delete, incoming delete upon switch'
         + ' Source  left: .dir.*/D/D1@2'
-        + ' Source right: .none.*/D/D1@3$',
+        + ' Source right: .none.*(/D/D1@3)?$',
     },
     'DD/D1' : {
       'Tree conflict' :
@@ -2528,37 +2528,37 @@ def tree_conflicts_on_switch_2_1(sbox):
       'Tree conflict' :
         '^local edit, incoming delete upon switch'
         + ' Source  left: .file.*/F/alpha@2'
-        + ' Source right: .none.*/F/alpha@3$',
+        + ' Source right: .none.*(/F/alpha@3)?$',
     },
     'DF/D1' : {
       'Tree conflict' :
         '^local edit, incoming delete upon switch'
         + ' Source  left: .dir.*/DF/D1@2'
-        + ' Source right: .none.*/DF/D1@3$',
+        + ' Source right: .none.*(/DF/D1@3)?$',
     },
     'DDF/D1' : {
       'Tree conflict' :
         '^local edit, incoming delete upon switch'
         + ' Source  left: .dir.*/DDF/D1@2'
-        + ' Source right: .none.*/DDF/D1@3$',
+        + ' Source right: .none.*(/DDF/D1@3)?$',
     },
     'D/D1' : {
       'Tree conflict' :
         '^local edit, incoming delete upon switch'
         + ' Source  left: .dir.*/D/D1@2'
-        + ' Source right: .none.*/D/D1@3$',
+        + ' Source right: .none.*(/D/D1@3)?$',
     },
     'DD/D1' : {
       'Tree conflict' :
         '^local edit, incoming delete upon switch'
         + ' Source  left: .dir.*/DD/D1@2'
-        + ' Source right: .none.*/DD/D1@3$',
+        + ' Source right: .none.*(/DD/D1@3)?$',
     },
     'DDD/D1' : {
       'Tree conflict' :
         '^local edit, incoming delete upon switch'
         + ' Source  left: .dir.*/DDD/D1@2'
-        + ' Source right: .none.*/DDD/D1@3$',
+        + ' Source right: .none.*(/DDD/D1@3)?$',
     },
   }
 
@@ -2627,37 +2627,37 @@ def tree_conflicts_on_switch_2_2(sbox):
       'Tree conflict' :
         '^local delete, incoming delete upon switch'
         + ' Source  left: .file.*/F/alpha@2'
-        + ' Source right: .none.*/F/alpha@3$',
+        + ' Source right: .none.*(/F/alpha@3)?$',
     },
     'DF/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon switch'
         + ' Source  left: .dir.*/DF/D1@2'
-        + ' Source right: .none.*/DF/D1@3$',
+        + ' Source right: .none.*(/DF/D1@3)?$',
     },
     'DDF/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon switch'
         + ' Source  left: .dir.*/DDF/D1@2'
-        + ' Source right: .none.*/DDF/D1@3$',
+        + ' Source right: .none.*(/DDF/D1@3)?$',
     },
     'D/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon switch'
         + ' Source  left: .dir.*/D/D1@2'
-        + ' Source right: .none.*/D/D1@3$',
+        + ' Source right: .none.*(/D/D1@3)?$',
     },
     'DD/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon switch'
         + ' Source  left: .dir.*/DD/D1@2'
-        + ' Source right: .none.*/DD/D1@3$',
+        + ' Source right: .none.*(/DD/D1@3)?$',
     },
     'DDD/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon switch'
         + ' Source  left: .dir.*/DDD/D1@2'
-        + ' Source right: .none.*/DDD/D1@3$',
+        + ' Source right: .none.*(/DDD/D1@3)?$',
     },
   }
 
@@ -2716,37 +2716,37 @@ def tree_conflicts_on_switch_3(sbox):
       'Tree conflict' :
         '^local delete, incoming delete upon switch'
         + ' Source  left: .file.*/F/alpha@2'
-        + ' Source right: .none.*/F/alpha@3$',
+        + ' Source right: .none.*(/F/alpha@3)?$',
     },
     'DF/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon switch'
         + ' Source  left: .dir.*/DF/D1@2'
-        + ' Source right: .none.*/DF/D1@3$',
+        + ' Source right: .none.*(/DF/D1@3)?$',
     },
     'DDF/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon switch'
         + ' Source  left: .dir.*/DDF/D1@2'
-        + ' Source right: .none.*/DDF/D1@3$',
+        + ' Source right: .none.*(/DDF/D1@3)?$',
     },
     'D/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon switch'
         + ' Source  left: .dir.*/D/D1@2'
-        + ' Source right: .none.*/D/D1@3$',
+        + ' Source right: .none.*(/D/D1@3)?$',
     },
     'DD/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon switch'
         + ' Source  left: .dir.*/DD/D1@2'
-        + ' Source right: .none.*/DD/D1@3$',
+        + ' Source right: .none.*(/DD/D1@3)?$',
     },
     'DDD/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon switch'
         + ' Source  left: .dir.*/DDD/D1@2'
-        + ' Source right: .none.*/DDD/D1@3$',
+        + ' Source right: .none.*(/DDD/D1@3)?$',
     },
   }
 

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/update_tests.py?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/update_tests.py Wed Jul 11 10:26:19 2012
@@ -310,7 +310,6 @@ def update_binary_file_2(sbox):
 
 #----------------------------------------------------------------------
 
-@XFail()
 @Issue(4128)
 def update_binary_file_3(sbox):
   "update locally modified file to equal versions"
@@ -367,7 +366,7 @@ def update_binary_file_3(sbox):
 
   # Create expected output tree for an update to rev 2.
   expected_output = svntest.wc.State(wc_dir, {
-    'A/theta' : Item(status='  '),
+    'A/theta' : Item(status='G '),
     })
 
   # Create expected disk tree for the update
@@ -3915,8 +3914,12 @@ def update_accept_conflicts(sbox):
   # Accept the pre-update base file.
   svntest.actions.run_and_verify_svn(None,
                                      ["Updating '%s':\n" % (mu_path_backup),
-                                      'G    %s\n' % (mu_path_backup,),
-                                      'Updated to revision 2.\n'],
+                                      'C    %s\n' % (mu_path_backup,),
+                                      'Updated to revision 2.\n',
+                                      'Summary of conflicts:\n',
+                                      '  Text conflicts: 1\n',
+                                      "Resolved conflicted state of '%s'\n"
+                                        % (mu_path_backup)],
                                      [],
                                      'update', '--accept=base',
                                      mu_path_backup)
@@ -3925,8 +3928,12 @@ def update_accept_conflicts(sbox):
   # Accept the user's working file.
   svntest.actions.run_and_verify_svn(None,
                                      ["Updating '%s':\n" % (alpha_path_backup),
-                                      'G    %s\n' % (alpha_path_backup,),
-                                      'Updated to revision 2.\n'],
+                                      'C    %s\n' % (alpha_path_backup,),
+                                      'Updated to revision 2.\n',
+                                      'Summary of conflicts:\n',
+                                      '  Text conflicts: 1\n',
+                                      "Resolved conflicted state of '%s'\n"
+                                        % (alpha_path_backup)],
                                      [],
                                      'update', '--accept=mine-full',
                                      alpha_path_backup)
@@ -3935,8 +3942,12 @@ def update_accept_conflicts(sbox):
   # Accept their file.
   svntest.actions.run_and_verify_svn(None,
                                      ["Updating '%s':\n" % (beta_path_backup),
-                                      'G    %s\n' % (beta_path_backup,),
-                                      'Updated to revision 2.\n'],
+                                      'C    %s\n' % (beta_path_backup,),
+                                      'Updated to revision 2.\n',
+                                      'Summary of conflicts:\n',
+                                      '  Text conflicts: 1\n',
+                                      "Resolved conflicted state of '%s'\n"
+                                        % (beta_path_backup)],
                                      [],
                                      'update', '--accept=theirs-full',
                                      beta_path_backup)
@@ -3947,8 +3958,12 @@ def update_accept_conflicts(sbox):
   # svn to exit with an exit code of 0.
   svntest.actions.run_and_verify_svn2(None,
                                       ["Updating '%s':\n" % (pi_path_backup),
-                                       'G    %s\n' % (pi_path_backup,),
-                                       'Updated to revision 2.\n'],
+                                       'C    %s\n' % (pi_path_backup,),
+                                       'Updated to revision 2.\n',
+                                      'Summary of conflicts:\n',
+                                      '  Text conflicts: 1\n',
+                                      "Resolved conflicted state of '%s'\n"
+                                        % (pi_path_backup)],
                                       "system(.*) returned.*", 0,
                                       'update', '--accept=edit',
                                       pi_path_backup)
@@ -4096,14 +4111,27 @@ interactive-conflicts = true
                                         wc_dir, '--config-dir', config_dir)
 
   # Now update -r1 again.  Hopefully we don't get a checksum error!
-  expected_output = svntest.wc.State(wc_dir, {})
+  expected_output = svntest.wc.State(wc_dir, {
+    'iota': Item(verb="Skipped"),
+  })
+
+  # The interactive callback aborts, so the file remains in conflict.
+  expected_disk.tweak('iota', contents="This is the file 'iota'.\n"
+                                        "<<<<<<< .mine\n"
+                                        "Local mods to r1 text.\n"
+                                        "=======\n"
+                                        "Appended text in r2.\n"
+                                        ">>>>>>> .r2\n"),
+  expected_disk.add({
+    'iota.r1'   : Item(contents="This is the file 'iota'.\n"),
+    'iota.r2'   : Item(contents="This is the file 'iota'.\n"
+                                 "Appended text in r2.\n"),
+    'iota.mine' : Item(contents="This is the file 'iota'.\n"
+                                "Local mods to r1 text.\n"),
+  })
 
-  # note: it's possible that the correct disk here should be the
-  # merged file?
-  expected_disk.tweak('iota', contents=("This is the file 'iota'.\n"
-                                        "Local mods to r1 text.\n"))
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
-  expected_status.tweak('iota', status='M ')
+  expected_status.tweak('iota', status='C ', wc_rev=2)
 
   svntest.actions.run_and_verify_update(wc_dir,
                                         expected_output,
@@ -4421,7 +4449,7 @@ def tree_conflicts_on_update_1_2(sbox):
       'Tree conflict' :
         '^local delete, incoming delete upon update'
         + ' Source  left: .file.*/F/alpha@2'
-        + ' Source right: .none.*/F/alpha@3$',
+        + ' Source right: .none.*(/F/alpha@3)?$',
     },
     'DF/D1' : {
       'Tree conflict' :
@@ -4439,7 +4467,7 @@ def tree_conflicts_on_update_1_2(sbox):
       'Tree conflict' :
         '^local delete, incoming delete upon update'
         + ' Source  left: .dir.*/D/D1@2'
-        + ' Source right: .none.*/D/D1@3$',
+        + ' Source right: .none.*(/D/D1@3)?$',
     },
     'DD/D1' : {
       'Tree conflict' :
@@ -4504,37 +4532,37 @@ def tree_conflicts_on_update_2_1(sbox):
       'Tree conflict' :
         '^local edit, incoming delete upon update'
         + ' Source  left: .file.*/F/alpha@2'
-        + ' Source right: .none.*/F/alpha@3$',
+        + ' Source right: .none.*(/F/alpha@3)?$',
     },
     'DF/D1' : {
       'Tree conflict' :
         '^local edit, incoming delete upon update'
         + ' Source  left: .dir.*/DF/D1@2'
-        + ' Source right: .none.*/DF/D1@3$',
+        + ' Source right: .none.*(/DF/D1@3)?$',
     },
     'DDF/D1' : {
       'Tree conflict' :
         '^local edit, incoming delete upon update'
         + ' Source  left: .dir.*/DDF/D1@2'
-        + ' Source right: .none.*/DDF/D1@3$',
+        + ' Source right: .none.*(/DDF/D1@3)?$',
     },
     'D/D1' : {
       'Tree conflict' :
         '^local edit, incoming delete upon update'
         + ' Source  left: .dir.*/D/D1@2'
-        + ' Source right: .none.*/D/D1@3$',
+        + ' Source right: .none.*(/D/D1@3)?$',
     },
     'DD/D1' : {
       'Tree conflict' :
         '^local edit, incoming delete upon update'
         + ' Source  left: .dir.*/DD/D1@2'
-        + ' Source right: .none.*/DD/D1@3$',
+        + ' Source right: .none.*(/DD/D1@3)?$',
     },
     'DDD/D1' : {
       'Tree conflict' :
         '^local edit, incoming delete upon update'
         + ' Source  left: .dir.*/DDD/D1@2'
-        + ' Source right: .none.*/DDD/D1@3$',
+        + ' Source right: .none.*(/DDD/D1@3)?$',
     },
   }
 
@@ -4612,37 +4640,37 @@ def tree_conflicts_on_update_2_2(sbox):
       'Tree conflict' :
         '^local delete, incoming delete upon update'
         + ' Source  left: .file.*/F/alpha@2'
-        + ' Source right: .none.*/F/alpha@3$',
+        + ' Source right: .none.*(/F/alpha@3)?$',
     },
     'DF/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon update'
         + ' Source  left: .dir.*/DF/D1@2'
-        + ' Source right: .none.*/DF/D1@3$',
+        + ' Source right: .none.*(/DF/D1@3)?$',
     },
     'DDF/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon update'
         + ' Source  left: .dir.*/DDF/D1@2'
-        + ' Source right: .none.*/DDF/D1@3$',
+        + ' Source right: .none.*(/DDF/D1@3)?$',
     },
     'D/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon update'
         + ' Source  left: .dir.*/D/D1@2'
-        + ' Source right: .none.*/D/D1@3$',
+        + ' Source right: .none.*(/D/D1@3)?$',
     },
     'DD/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon update'
         + ' Source  left: .dir.*/DD/D1@2'
-        + ' Source right: .none.*/DD/D1@3$',
+        + ' Source right: .none.*(/DD/D1@3)?$',
     },
     'DDD/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon update'
         + ' Source  left: .dir.*/DDD/D1@2'
-        + ' Source right: .none.*/DDD/D1@3$',
+        + ' Source right: .none.*(/DDD/D1@3)?$',
     },
   }
 
@@ -4774,37 +4802,37 @@ def tree_conflicts_on_update_3(sbox):
       'Tree conflict' :
         '^local delete, incoming delete upon update'
         + ' Source  left: .file.*/F/alpha@2'
-        + ' Source right: .none.*/F/alpha@3$',
+        + ' Source right: .none.*(/F/alpha@3)?$',
     },
     'DF/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon update'
         + ' Source  left: .dir.*/DF/D1@2'
-        + ' Source right: .none.*/DF/D1@3$',
+        + ' Source right: .none.*(/DF/D1@3)?$',
     },
     'DDF/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon update'
         + ' Source  left: .dir.*/DDF/D1@2'
-        + ' Source right: .none.*/DDF/D1@3$',
+        + ' Source right: .none.*(/DDF/D1@3)?$',
     },
     'D/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon update'
         + ' Source  left: .dir.*/D/D1@2'
-        + ' Source right: .none.*/D/D1@3$',
+        + ' Source right: .none.*(/D/D1@3)?$',
     },
     'DD/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon update'
         + ' Source  left: .dir.*/DD/D1@2'
-        + ' Source right: .none.*/DD/D1@3$',
+        + ' Source right: .none.*(/DD/D1@3)?$',
     },
     'DDD/D1' : {
       'Tree conflict' :
         '^local delete, incoming delete upon update'
         + ' Source  left: .dir.*/DDD/D1@2'
-        + ' Source right: .none.*/DDD/D1@3$',
+        + ' Source right: .none.*(/DDD/D1@3)?$',
     },
   }
 

Modified: subversion/branches/ev2-export/subversion/tests/libsvn_delta/random-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_delta/random-test.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_delta/random-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_delta/random-test.c Wed Jul 11 10:26:19 2012
@@ -198,7 +198,7 @@ generate_random_file(apr_uint32_t maxlen
               buf = file_buffer;
             }
 
-          *buf++ = ch;
+          *buf++ = (char)ch;
           r = r * 1103515245 + 12345;
         }
     }

Modified: subversion/branches/ev2-export/subversion/tests/libsvn_diff/diff-diff3-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_diff/diff-diff3-test.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_diff/diff-diff3-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_diff/diff-diff3-test.c Wed Jul 11 10:26:19 2012
@@ -2405,7 +2405,7 @@ test_wrap(apr_pool_t *pool)
   char rdata[(1<<17) + 4+3+3+1];
   svn_string_t left, right;
   svn_diff_file_options_t *diff_opts = svn_diff_file_options_create(pool);
-  diff_opts->ignore_space = TRUE;
+  diff_opts->ignore_space = svn_diff_file_ignore_space_change;
 
   /* Two long lines. */
   memset(ldata, '@', 1<<17);

Modified: subversion/branches/ev2-export/subversion/tests/libsvn_fs_fs/fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_fs_fs/fs-pack-test.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_fs_fs/fs-pack-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_fs_fs/fs-pack-test.c Wed Jul 11 10:26:19 2012
@@ -30,6 +30,7 @@
 #include "svn_pools.h"
 #include "svn_props.h"
 #include "svn_fs.h"
+#include "private/svn_string_private.h"
 
 #include "../svn_test_fs.h"
 
@@ -199,6 +200,77 @@ create_packed_filesystem(const char *dir
   return svn_fs_pack(dir, pack_notify, &pnb, NULL, NULL, pool);
 }
 
+/* Create a packed FSFS filesystem for revprop tests at REPO_NAME with
+ * MAX_REV revisions and the given SHARD_SIZE and OPTS.  Return it in *FS.
+ * Use POOL for allocations.
+ */
+static svn_error_t *
+prepare_revprop_repo(svn_fs_t **fs,
+                     const char *repo_name,
+                     int max_rev,
+                     int shard_size,
+                     const svn_test_opts_t *opts,
+                     apr_pool_t *pool)
+{
+  svn_fs_txn_t *txn;
+  svn_fs_root_t *txn_root;
+  const char *conflict;
+  svn_revnum_t after_rev;
+  apr_pool_t *subpool;
+
+  /* Create the packed FS and open it. */
+  SVN_ERR(create_packed_filesystem(repo_name, opts, max_rev, shard_size, pool));
+  SVN_ERR(svn_fs_open(fs, repo_name, NULL, pool));
+
+  subpool = svn_pool_create(pool);
+  /* Do a commit to trigger packing. */
+  SVN_ERR(svn_fs_begin_txn(&txn, *fs, max_rev, subpool));
+  SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
+  SVN_ERR(svn_test__set_file_contents(txn_root, "iota", "new-iota",  subpool));
+  SVN_ERR(svn_fs_commit_txn(&conflict, &after_rev, txn, subpool));
+  SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(after_rev));
+  svn_pool_destroy(subpool);
+
+  /* Pack the repository. */
+  SVN_ERR(svn_fs_pack(repo_name, NULL, NULL, NULL, NULL, pool));
+
+  return SVN_NO_ERROR;
+}
+
+/* For revision REV, return a short log message allocated in POOL.
+ */
+static svn_string_t *
+default_log(svn_revnum_t rev, apr_pool_t *pool)
+{
+  return svn_string_createf(pool, "Default message for rev %ld", rev);
+}
+
+/* For revision REV, return a long log message allocated in POOL.
+ */
+static svn_string_t *
+large_log(svn_revnum_t rev, apr_size_t length, apr_pool_t *pool)
+{
+  svn_stringbuf_t *temp = svn_stringbuf_create_ensure(100000, pool);
+  int i, count = (int)(length - 50) / 6;
+
+  svn_stringbuf_appendcstr(temp, "A ");
+  for (i = 0; i < count; ++i)
+    svn_stringbuf_appendcstr(temp, "very, ");
+  
+  svn_stringbuf_appendcstr(temp,
+    apr_psprintf(pool, "very long message for rev %ld, indeed", rev));
+
+  return svn_stringbuf__morph_into_string(temp);
+}
+
+/* For revision REV, return a long log message allocated in POOL.
+ */
+static svn_string_t *
+huge_log(svn_revnum_t rev, apr_pool_t *pool)
+{
+  return large_log(rev, 90000, pool);
+}
+
 
 /*** Tests ***/
 
@@ -404,18 +476,13 @@ commit_packed_fs(const svn_test_opts_t *
 /* ------------------------------------------------------------------------ */
 #define REPO_NAME "test-repo-get-set-revprop-packed-fs"
 #define SHARD_SIZE 4
-#define MAX_REV 1
+#define MAX_REV 10
 static svn_error_t *
 get_set_revprop_packed_fs(const svn_test_opts_t *opts,
                           apr_pool_t *pool)
 {
   svn_fs_t *fs;
-  svn_fs_txn_t *txn;
-  svn_fs_root_t *txn_root;
-  const char *conflict;
-  svn_revnum_t after_rev;
   svn_string_t *prop_value;
-  apr_pool_t *subpool;
 
   /* Bail (with success) on known-untestable scenarios */
   if ((strcmp(opts->fs_type, "fsfs") != 0)
@@ -423,30 +490,179 @@ get_set_revprop_packed_fs(const svn_test
     return SVN_NO_ERROR;
 
   /* Create the packed FS and open it. */
-  SVN_ERR(create_packed_filesystem(REPO_NAME, opts, MAX_REV, SHARD_SIZE, pool));
-  SVN_ERR(svn_fs_open(&fs, REPO_NAME, NULL, pool));
-
-  subpool = svn_pool_create(pool);
-  /* Do a commit to trigger packing. */
-  SVN_ERR(svn_fs_begin_txn(&txn, fs, MAX_REV, subpool));
-  SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
-  SVN_ERR(svn_test__set_file_contents(txn_root, "iota", "new-iota",  subpool));
-  SVN_ERR(svn_fs_commit_txn(&conflict, &after_rev, txn, subpool));
-  SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(after_rev));
-  svn_pool_clear(subpool);
-
-  /* Pack the repository. */
-  SVN_ERR(svn_fs_pack(REPO_NAME, NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(prepare_revprop_repo(&fs, REPO_NAME, MAX_REV, SHARD_SIZE, opts,
+                               pool));
 
-  /* Try to get revprop for revision 0. */
+  /* Try to get revprop for revision 0
+   * (non-packed due to special handling). */
   SVN_ERR(svn_fs_revision_prop(&prop_value, fs, 0, SVN_PROP_REVISION_AUTHOR,
                                pool));
 
-  /* Try to change revprop for revision 0. */
+  /* Try to change revprop for revision 0
+   * (non-packed due to special handling). */
   SVN_ERR(svn_fs_change_rev_prop(fs, 0, SVN_PROP_REVISION_AUTHOR,
                                  svn_string_create("tweaked-author", pool),
                                  pool));
 
+  /* verify */
+  SVN_ERR(svn_fs_revision_prop(&prop_value, fs, 0, SVN_PROP_REVISION_AUTHOR,
+                               pool));
+  SVN_TEST_STRING_ASSERT(prop_value->data, "tweaked-author");
+
+  /* Try to get packed revprop for revision 5. */
+  SVN_ERR(svn_fs_revision_prop(&prop_value, fs, 5, SVN_PROP_REVISION_AUTHOR,
+                               pool));
+
+  /* Try to change packed revprop for revision 5. */
+  SVN_ERR(svn_fs_change_rev_prop(fs, 5, SVN_PROP_REVISION_AUTHOR,
+                                 svn_string_create("tweaked-author2", pool),
+                                 pool));
+
+  /* verify */
+  SVN_ERR(svn_fs_revision_prop(&prop_value, fs, 5, SVN_PROP_REVISION_AUTHOR,
+                               pool));
+  SVN_TEST_STRING_ASSERT(prop_value->data, "tweaked-author2");
+
+  return SVN_NO_ERROR;
+}
+#undef REPO_NAME
+#undef MAX_REV
+#undef SHARD_SIZE
+
+/* ------------------------------------------------------------------------ */
+#define REPO_NAME "test-repo-get-set-large-revprop-packed-fs"
+#define SHARD_SIZE 4
+#define MAX_REV 11
+static svn_error_t *
+get_set_large_revprop_packed_fs(const svn_test_opts_t *opts,
+                                apr_pool_t *pool)
+{
+  svn_fs_t *fs;
+  svn_string_t *prop_value;
+  svn_revnum_t rev;
+
+  /* Bail (with success) on known-untestable scenarios */
+  if ((strcmp(opts->fs_type, "fsfs") != 0)
+      || (opts->server_minor_version && (opts->server_minor_version < 7)))
+    return SVN_NO_ERROR;
+
+  /* Create the packed FS and open it. */
+  SVN_ERR(prepare_revprop_repo(&fs, REPO_NAME, MAX_REV, SHARD_SIZE, opts,
+                               pool));
+
+  /* Set commit messages to different, large values that fill the pack
+   * files but do not exceed the pack size limit. */
+  for (rev = 0; rev <= MAX_REV; ++rev)
+    SVN_ERR(svn_fs_change_rev_prop(fs, rev, SVN_PROP_REVISION_LOG,
+                                   large_log(rev, 15000, pool),
+                                   pool));
+
+  /* verify */
+  for (rev = 0; rev <= MAX_REV; ++rev)
+    {
+      SVN_ERR(svn_fs_revision_prop(&prop_value, fs, rev,
+                                   SVN_PROP_REVISION_LOG, pool));
+      SVN_TEST_STRING_ASSERT(prop_value->data,
+                             large_log(rev, 15000, pool)->data);
+    }
+
+  /* Put a larger revprop into the last, some middle and the first revision
+   * of a pack.  This should cause the packs to split in the middle. */
+  SVN_ERR(svn_fs_change_rev_prop(fs, 3, SVN_PROP_REVISION_LOG,
+                                 /* rev 0 is not packed */
+                                 large_log(3, 37000, pool),
+                                 pool));
+  SVN_ERR(svn_fs_change_rev_prop(fs, 5, SVN_PROP_REVISION_LOG,
+                                 large_log(5, 25000, pool),
+                                 pool));
+  SVN_ERR(svn_fs_change_rev_prop(fs, 8, SVN_PROP_REVISION_LOG,
+                                 large_log(8, 25000, pool),
+                                 pool));
+
+  /* verify */
+  for (rev = 0; rev <= MAX_REV; ++rev)
+    {
+      SVN_ERR(svn_fs_revision_prop(&prop_value, fs, rev,
+                                   SVN_PROP_REVISION_LOG, pool));
+
+      if (rev == 3)
+        SVN_TEST_STRING_ASSERT(prop_value->data,
+                               large_log(rev, 37000, pool)->data);
+      else if (rev == 5 || rev == 8)
+        SVN_TEST_STRING_ASSERT(prop_value->data,
+                               large_log(rev, 25000, pool)->data);
+      else
+        SVN_TEST_STRING_ASSERT(prop_value->data,
+                               large_log(rev, 15000, pool)->data);
+    }
+
+  return SVN_NO_ERROR;
+}
+#undef REPO_NAME
+#undef MAX_REV
+#undef SHARD_SIZE
+
+/* ------------------------------------------------------------------------ */
+#define REPO_NAME "test-repo-get-set-huge-revprop-packed-fs"
+#define SHARD_SIZE 4
+#define MAX_REV 10
+static svn_error_t *
+get_set_huge_revprop_packed_fs(const svn_test_opts_t *opts,
+                               apr_pool_t *pool)
+{
+  svn_fs_t *fs;
+  svn_string_t *prop_value;
+  svn_revnum_t rev;
+
+  /* Bail (with success) on known-untestable scenarios */
+  if ((strcmp(opts->fs_type, "fsfs") != 0)
+      || (opts->server_minor_version && (opts->server_minor_version < 7)))
+    return SVN_NO_ERROR;
+
+  /* Create the packed FS and open it. */
+  SVN_ERR(prepare_revprop_repo(&fs, REPO_NAME, MAX_REV, SHARD_SIZE, opts,
+                               pool));
+
+  /* Set commit messages to different values */
+  for (rev = 0; rev <= MAX_REV; ++rev)
+    SVN_ERR(svn_fs_change_rev_prop(fs, rev, SVN_PROP_REVISION_LOG,
+                                   default_log(rev, pool),
+                                   pool));
+
+  /* verify */
+  for (rev = 0; rev <= MAX_REV; ++rev)
+    {
+      SVN_ERR(svn_fs_revision_prop(&prop_value, fs, rev,
+                                   SVN_PROP_REVISION_LOG, pool));
+      SVN_TEST_STRING_ASSERT(prop_value->data, default_log(rev, pool)->data);
+    }
+
+  /* Put a huge revprop into the last, some middle and the first revision
+   * of a pack.  They will cause the pack files to split accordingly. */
+  SVN_ERR(svn_fs_change_rev_prop(fs, 3, SVN_PROP_REVISION_LOG,
+                                 huge_log(3, pool),
+                                 pool));
+  SVN_ERR(svn_fs_change_rev_prop(fs, 5, SVN_PROP_REVISION_LOG,
+                                 huge_log(5, pool),
+                                 pool));
+  SVN_ERR(svn_fs_change_rev_prop(fs, 8, SVN_PROP_REVISION_LOG,
+                                 huge_log(8, pool),
+                                 pool));
+
+  /* verify */
+  for (rev = 0; rev <= MAX_REV; ++rev)
+    {
+      SVN_ERR(svn_fs_revision_prop(&prop_value, fs, rev,
+                                   SVN_PROP_REVISION_LOG, pool));
+
+      if (rev == 3 || rev == 5 || rev == 8)
+        SVN_TEST_STRING_ASSERT(prop_value->data,
+                               huge_log(rev, pool)->data);
+      else
+        SVN_TEST_STRING_ASSERT(prop_value->data,
+                               default_log(rev, pool)->data);
+    }
+
   return SVN_NO_ERROR;
 }
 #undef REPO_NAME
@@ -533,6 +749,10 @@ struct svn_test_descriptor_t test_funcs[
                        "commit to a packed FSFS filesystem"),
     SVN_TEST_OPTS_PASS(get_set_revprop_packed_fs,
                        "get/set revprop while packing FSFS filesystem"),
+    SVN_TEST_OPTS_PASS(get_set_large_revprop_packed_fs,
+                       "get/set large packed revprops in FSFS"),
+    SVN_TEST_OPTS_PASS(get_set_huge_revprop_packed_fs,
+                       "get/set huge packed revprops in FSFS"),
     SVN_TEST_OPTS_PASS(recover_fully_packed,
                        "recover a fully packed filesystem"),
     SVN_TEST_NULL

Modified: subversion/branches/ev2-export/subversion/tests/libsvn_repos/repos-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_repos/repos-test.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_repos/repos-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_repos/repos-test.c Wed Jul 11 10:26:19 2012
@@ -2256,7 +2256,7 @@ prop_validation(const svn_test_opts_t *o
 {
   svn_error_t *err;
   svn_repos_t *repos;
-  const char non_utf8_string[5] = { 'a', 0xff, 'b', '\n', 0 };
+  const char non_utf8_string[5] = { 'a', (char)0xff, 'b', '\n', 0 };
   const char *non_lf_string = "a\r\nb\n\rc\rd\n";
   apr_pool_t *subpool = svn_pool_create(pool);
 

Propchange: subversion/branches/ev2-export/subversion/tests/libsvn_subr/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jul 11 10:26:19 2012
@@ -38,3 +38,5 @@ subst_translate-test
 spillbuf-test
 named_atomic-test
 named_atomic-proc-test
+io-test
+io-test-temp

Modified: subversion/branches/ev2-export/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_subr/dirent_uri-test.c Wed Jul 11 10:26:19 2012
@@ -2019,15 +2019,34 @@ test_dirent_condense_targets(apr_pool_t 
       const char* common;
       apr_array_header_t *hdr = apr_array_make(pool, 8, sizeof(const char*));
       apr_array_header_t *condensed;
+      svn_boolean_t skip = FALSE;
 
       for (j = 0; j < COUNT_OF(tests[i].paths); j++)
         {
           if (tests[i].paths[j] != NULL)
-            APR_ARRAY_PUSH(hdr, const char*) = tests[i].paths[j];
+            {
+              APR_ARRAY_PUSH(hdr, const char*) = tests[i].paths[j];
+#ifdef SVN_USE_DOS_PATHS
+              /* For tests that are referencing a D: drive, specifically test
+                 if such a drive exists on the system.  If not, skip the test
+                 (svn_dirent_condense_targets will fail, because
+                 apr_filepath_merge will produce an APR_EBADPATH error). */
+              if (strncmp(tests[i].paths[j], "D:", 2) == 0
+                  && GetDriveType("D:\\") == DRIVE_NO_ROOT_DIR)
+                {
+                  /* There is no D: drive, skip this. */
+                  skip = TRUE;
+                  break;
+                }
+#endif
+            }
           else
             break;
         }
 
+      if (skip)
+        continue;
+
       SVN_ERR(svn_dirent_condense_targets(&common, &condensed, hdr,
                                           FALSE, pool, pool));
 

Modified: subversion/branches/ev2-export/subversion/tests/libsvn_subr/mergeinfo-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_subr/mergeinfo-test.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_subr/mergeinfo-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_subr/mergeinfo-test.c Wed Jul 11 10:26:19 2012
@@ -712,7 +712,7 @@ test_merge_mergeinfo(apr_pool_t *pool)
       SVN_ERR(svn_mergeinfo_to_string(&info2_starting, info2, pool));
 
       SVN_ERR(svn_mergeinfo_merge(info1, info2, pool));
-      if (mergeinfo[i].expected_paths != apr_hash_count(info1))
+      if (mergeinfo[i].expected_paths != (int)apr_hash_count(info1))
         return fail(pool, "Wrong number of paths in merged mergeinfo");
 
       /* Check that info2 remained unchanged. */

Modified: subversion/branches/ev2-export/subversion/tests/libsvn_subr/named_atomic-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_subr/named_atomic-test.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_subr/named_atomic-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_subr/named_atomic-test.c Wed Jul 11 10:26:19 2012
@@ -82,7 +82,10 @@ proc_found(const char *proc, apr_pool_t 
 
       /* all processes and their I/O data */
       apr_proc_t process;
-      const char * args[2] = {proc, NULL};
+      const char * args[2];
+
+      args[0] = proc;
+      args[1] = NULL;
       svn_error_clear(adjust_proc_path(&args[0], &directory, pool));
 
       /* try to start the process */
@@ -307,15 +310,14 @@ run_procs(apr_pool_t *pool, const char *
   /* start sub-processes */
   for (i = 0; i < count; ++i)
     {
-      const char * args[6] =
-        {
-          proc,
-          apr_itoa(pool, i),
-          apr_itoa(pool, count),
-          apr_itoa(pool, iterations),
-          name_namespace,
-          NULL
-        };
+      const char * args[6];
+
+      args[0] = proc;
+      args[1] = apr_itoa(pool, i);
+      args[2] = apr_itoa(pool, count);
+      args[3] = apr_itoa(pool, iterations);
+      args[4] = name_namespace;
+      args[5] = NULL;
 
       error = svn_io_start_cmd3(&process[i],
                                 directory,  /* working directory */

Modified: subversion/branches/ev2-export/subversion/tests/libsvn_subr/skel-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_subr/skel-test.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_subr/skel-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_subr/skel-test.c Wed Jul 11 10:26:19 2012
@@ -216,7 +216,7 @@ gen_implicit_length_all_chars(apr_size_t
   for (i = 0; i < 256; i++)
     if (! skel_is_space( (apr_byte_t)i)
         && ! skel_is_paren( (apr_byte_t)i))
-      name[pos++] = i;
+      name[pos++] = (char)i;
 
   *len_p = pos;
   return name;
@@ -375,7 +375,7 @@ parse_explicit_length(apr_pool_t *pool)
       {
         char buf[1];
 
-        buf[0] = i;
+        buf[0] = (char)i;
         SVN_ERR(try_explicit_length(buf, 1, 1, pool));
       }
   }
@@ -386,7 +386,7 @@ parse_explicit_length(apr_pool_t *pool)
     char data[256];
 
     for (i = 0; i < 256; i++)
-      data[i] = i;
+      data[i] = (char)i;
 
     SVN_ERR(try_explicit_length(data, 256, 256, pool));
   }
@@ -592,7 +592,7 @@ parse_list(apr_pool_t *pool)
                       svn_skel_t *child;
                       char buf[1];
 
-                      buf[0] = atom_byte;
+                      buf[0] = (char)atom_byte;
 
                       put_list_start(str,  (apr_byte_t)sep, sep_count);
                       for (i = 0; i < list_len; i++)
@@ -619,7 +619,7 @@ parse_list(apr_pool_t *pool)
                     char data[256];
 
                     for (i = 0; i < 256; i++)
-                      data[i] = i;
+                      data[i] = (char)i;
 
                     put_list_start(str,  (apr_byte_t)sep, sep_count);
                     for (i = 0; i < list_len; i++)
@@ -797,7 +797,7 @@ unparse_list(apr_pool_t *pool)
     for (byte = 0; byte < 256; byte++)
       if (skel_is_name( (apr_byte_t)byte))
         {
-          char buf = byte;
+          char buf = (char)byte;
           add(build_atom(1, &buf, pool), list);
         }
 
@@ -858,7 +858,7 @@ unparse_list(apr_pool_t *pool)
             val = i * 10 + j;
             for (k = 0; k < sizeof(buf); k++)
               {
-                buf[k] = val;
+                buf[k] = (char)val;
                 val += j;
               }
 

Modified: subversion/branches/ev2-export/subversion/tests/libsvn_subr/stream-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_subr/stream-test.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_subr/stream-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_subr/stream-test.c Wed Jul 11 10:26:19 2012
@@ -138,7 +138,7 @@ generate_test_bytes(int num_bytes, apr_p
         {
           if (c == 127)
             repeat++;
-          c = (c + 1) % 127;
+          c = (char)((c + 1) % 127);
           repeat_iter = repeat;
         }
     }