Index: subversion/tests/cmdline/svntest/actions.py
===================================================================
--- subversion/tests/cmdline/svntest/actions.py	(revision 32800)
+++ subversion/tests/cmdline/svntest/actions.py	(working copy)
@@ -1523,11 +1523,146 @@
          merged_text + ">>>>>>> .merge-right.r" + str(merged_rev) + "\n"
 
 
+def build_greek_tree_conflicts(sbox):
+  """Create a working copy that has tree-conflict markings.
+  After this function has been called, sbox.wc_dir is a working
+  copy that has specific tree-conflict markings.
 
+  In particular, this does two conflicting sets of edits and performs an
+  update so that tree conflicts appear.
 
+  Note that this function calls sbox.build() because it needs a clean sbox.
+  So, there is no need to call sbox.build() before this.
 
+  This function is useful for testing that tree-conflicts are handled
+  properly once they have appeared, e.g. that commits are blocked, that the
+  info output is correct, etc.
 
+  See also the tree-conflicts tests using deep_trees in various other
+  .py files, and tree_conflict_tests.py.
+  """
 
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  j = os.path.join
+  G = j(wc_dir, 'A', 'D', 'G')
+  pi = j(G, 'pi')
+  rho = j(G, 'rho')
+  tau = j(G, 'tau')
+
+  # Make incoming changes and "store them away" with a commit.
+  main.file_append(pi, "Incoming edit.\n")
+  main.run_svn(None, 'del', rho)
+  main.run_svn(None, 'del', tau)
+
+  expected_output = wc.State(wc_dir, {
+    'A/D/G/pi'          : Item(verb='Sending'),
+    'A/D/G/rho'         : Item(verb='Deleting'),
+    'A/D/G/tau'         : Item(verb='Deleting'),
+    })
+  expected_status = wc.State(wc_dir, {
+    ''                  : Item(status='  ', wc_rev='1'),
+    'A'                 : Item(status='  ', wc_rev='1'),
+    'A/D'               : Item(status='  ', wc_rev='1'),
+    'A/D/G'             : Item(status='  ', wc_rev='1'),
+    'A/D/G/pi'          : Item(status='  ', wc_rev='2'),
+    'A/D/gamma'         : Item(status='  ', wc_rev='1'),
+    'A/D/H'             : Item(status='  ', wc_rev='1'),
+    'A/D/H/chi'         : Item(status='  ', wc_rev='1'),
+    'A/D/H/omega'       : Item(status='  ', wc_rev='1'),
+    'A/D/H/psi'         : Item(status='  ', wc_rev='1'),
+    'A/B'               : Item(status='  ', wc_rev='1'),
+    'A/B/lambda'        : Item(status='  ', wc_rev='1'),
+    'A/B/E'             : Item(status='  ', wc_rev='1'),
+    'A/B/E/alpha'       : Item(status='  ', wc_rev='1'),
+    'A/B/E/beta'        : Item(status='  ', wc_rev='1'),
+    'A/B/F'             : Item(status='  ', wc_rev='1'),
+    'A/mu'              : Item(status='  ', wc_rev='1'),
+    'A/C'               : Item(status='  ', wc_rev='1'),
+    'iota'              : Item(status='  ', wc_rev='1'),
+    })
+  run_and_verify_commit(wc_dir, expected_output, expected_status, None,
+                        '-m', 'Incoming changes.', wc_dir )
+
+  # Update back to the pristine state ("time-warp").
+  expected_output = wc.State(wc_dir, {
+    'A/D/G/pi'          : Item(status='U '),
+    'A/D/G/rho'         : Item(status='A '),
+    'A/D/G/tau'         : Item(status='A '),
+    })
+  expected_disk = main.greek_state
+  expected_status = wc.State(wc_dir, {
+    ''                  : Item(status='  ', wc_rev='1'),
+    'A'                 : Item(status='  ', wc_rev='1'),
+    'A/D'               : Item(status='  ', wc_rev='1'),
+    'A/D/G'             : Item(status='  ', wc_rev='1'),
+    'A/D/G/pi'          : Item(status='  ', wc_rev='1'),
+    'A/D/G/rho'         : Item(status='  ', wc_rev='1'),
+    'A/D/G/tau'         : Item(status='  ', wc_rev='1'),
+    'A/D/gamma'         : Item(status='  ', wc_rev='1'),
+    'A/D/H'             : Item(status='  ', wc_rev='1'),
+    'A/D/H/chi'         : Item(status='  ', wc_rev='1'),
+    'A/D/H/omega'       : Item(status='  ', wc_rev='1'),
+    'A/D/H/psi'         : Item(status='  ', wc_rev='1'),
+    'A/B'               : Item(status='  ', wc_rev='1'),
+    'A/B/lambda'        : Item(status='  ', wc_rev='1'),
+    'A/B/E'             : Item(status='  ', wc_rev='1'),
+    'A/B/E/alpha'       : Item(status='  ', wc_rev='1'),
+    'A/B/E/beta'        : Item(status='  ', wc_rev='1'),
+    'A/B/F'             : Item(status='  ', wc_rev='1'),
+    'A/mu'              : Item(status='  ', wc_rev='1'),
+    'A/C'               : Item(status='  ', wc_rev='1'),
+    'iota'              : Item(status='  ', wc_rev='1'),
+    })
+  run_and_verify_update(wc_dir, expected_output, expected_disk,
+                        expected_status, None, None, None, None, None, False,
+                        '-r', '1', wc_dir)
+
+  # Make local changes
+  main.run_svn(None, 'del', pi)
+  main.file_append(rho, "Local edit.\n")
+  main.run_svn(None, 'del', tau)
+
+  # Update, receiving the incoming changes on top of the local changes,
+  # causing tree-conflicts.
+  expected_output = wc.State(wc_dir, {
+    'A/D/G'             : Item(status='C '),
+    'A/D/G/rho'         : Item(status='D '),
+    'A/D/G/tau'         : Item(status='D '),
+    'A/D/G/pi'          : Item(status='U '),
+    })
+  expected_disk = main.greek_state.copy()
+  expected_disk.tweak('A/D/G/pi',
+                      contents="This is the file 'pi'.\nIncoming edit.\n")
+  expected_disk.tweak('A/D/G/rho',
+                      contents="This is the file 'rho'.\nLocal edit.\n")
+  expected_disk.remove('A/D/G/tau')
+  expected_status = wc.State(wc_dir, {
+    ''                  : Item(status='  ', wc_rev='2'),
+    'iota'              : Item(status='  ', wc_rev='2'),
+    'A'                 : Item(status='  ', wc_rev='2'),
+    'A/B'               : Item(status='  ', wc_rev='2'),
+    'A/B/lambda'        : Item(status='  ', wc_rev='2'),
+    'A/B/E'             : Item(status='  ', wc_rev='2'),
+    'A/B/E/alpha'       : Item(status='  ', wc_rev='2'),
+    'A/B/E/beta'        : Item(status='  ', wc_rev='2'),
+    'A/B/F'             : Item(status='  ', wc_rev='2'),
+    'A/mu'              : Item(status='  ', wc_rev='2'),
+    'A/C'               : Item(status='  ', wc_rev='2'),
+    'A/D'               : Item(status='  ', wc_rev='2'),
+    'A/D/gamma'         : Item(status='  ', wc_rev='2'),
+    'A/D/G'             : Item(status='C ', wc_rev='2'),
+    'A/D/G/pi'          : Item(status='D ', wc_rev='2'),
+    'A/D/H'             : Item(status='  ', wc_rev='2'),
+    'A/D/H/chi'         : Item(status='  ', wc_rev='2'),
+    'A/D/H/omega'       : Item(status='  ', wc_rev='2'),
+    'A/D/H/psi'         : Item(status='  ', wc_rev='2'),
+    })
+  run_and_verify_update(wc_dir, expected_output, expected_disk,
+                        expected_status)
+
+
+
 def make_deep_trees(base):
   """Helper function for deep trees conflicts. Create a set of trees,
   each in its own "container" dir. Any conflicts can be tested separately
Index: subversion/tests/cmdline/revert_tests.py
===================================================================
--- subversion/tests/cmdline/revert_tests.py	(revision 32800)
+++ subversion/tests/cmdline/revert_tests.py	(working copy)
@@ -862,55 +862,48 @@
   
   # See use cases 1-3 in notes/tree-conflicts/use-cases.txt for background.
 
-  sbox.build()
+  svntest.actions.build_greek_tree_conflicts(sbox)
   wc_dir = sbox.wc_dir
   G = os.path.join(wc_dir, 'A', 'D', 'G')
 
-  # Set up tree conflicts in wc 2
-  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
+  # Duplicate wc for tests
+  wc_dir_2 =  sbox.add_wc_path('2')
+  svntest.actions.duplicate_dir(wc_dir, wc_dir_2)  
   G2 = os.path.join(wc_dir_2, 'A', 'D', 'G')
 
-  # Update in wc 2, revealing tree conflicts
-  svntest.main.run_svn(None, 'update', wc_dir_2)
-
-  # Duplicate wc 2 for tests
-  wc_dir_3 =  sbox.add_wc_path('3')
-  svntest.actions.duplicate_dir(wc_dir_2, wc_dir_3)  
-  G3 = os.path.join(wc_dir_3, 'A', 'D', 'G')
-
-  # Revert recursively in wc 2
+  # Revert recursively in wc
   expected_output = svntest.verify.UnorderedOutput(
-   ["Reverted '%s'\n" % G2,
-    "Reverted '%s'\n" % os.path.join(G2, 'pi'),
+   ["Reverted '%s'\n" % G,
+    "Reverted '%s'\n" % os.path.join(G, 'pi'),
     ])
   svntest.actions.run_and_verify_svn(None, expected_output, [], 
-                                     'revert', '-R', G2)
+                                     'revert', '-R', G)
 
-  expected_status = svntest.actions.get_virginal_state(wc_dir_2, 2)
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
   expected_status.tweak('A/D/G',     status='  ')
   expected_status.tweak('A/D/G/pi',  status='  ')
   expected_status.remove('A/D/G/rho',
                          'A/D/G/tau')
-  svntest.actions.run_and_verify_status(wc_dir_2, expected_status)
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
   
   expected_disk = svntest.main.greek_state.copy()
   expected_disk.tweak('A/D/G/pi',
-                      contents="This is the file 'pi'.\nEdited in wc 1.\n")
+                      contents="This is the file 'pi'.\nIncoming edit.\n")
   expected_disk.tweak('A/D/G/rho',
-                      contents="This is the file 'rho'.\nEdited in wc 2.\n")
+                      contents="This is the file 'rho'.\nLocal edit.\n")
   expected_disk.remove('A/D/G/tau')
-  svntest.actions.verify_disk(wc_dir_2, expected_disk)
+  svntest.actions.verify_disk(wc_dir, expected_disk)
   
-  # Revert only G in wc 3
+  # Revert only G in wc 2
   expected_output = svntest.verify.UnorderedOutput(
-   ["Reverted '%s'\n" % G3,
+   ["Reverted '%s'\n" % G2,
     ])
   svntest.actions.run_and_verify_svn(None, expected_output, [], 
-                                     'revert', G3)
+                                     'revert', G2)
 
-  expected_status.wc_dir = wc_dir_3
+  expected_status.wc_dir = wc_dir_2
   expected_status.tweak('A/D/G/pi',  status='D ') # not a recursive revert
-  svntest.actions.run_and_verify_status(wc_dir_3, expected_status)
+  svntest.actions.run_and_verify_status(wc_dir_2, expected_status)
   
   
 ########################################################################
Index: subversion/tests/cmdline/tree_conflict_tests.py
===================================================================
--- subversion/tests/cmdline/tree_conflict_tests.py	(revision 32800)
+++ subversion/tests/cmdline/tree_conflict_tests.py	(working copy)
@@ -289,7 +289,8 @@
 # Set up all of the given SCENARIOS in their respective unique paths.
 # This means committing their initialisation actions in r2, and then
 # committing their change actions in r3 (assuming the repos was at r1).
-# (See also the somewhat related svntest.actions.set_up_tree_conflicts().)
+# (See also the somewhat related svntest.actions.build_greek_tree_conflicts()
+# and tree-conflicts tests using deep_trees in various other .py files.)
 # SCENARIOS is a list of scenario tuples: (init_actions, change_actions).
 # WC_DIR is a local path of an existing WC.
 # BR_DIR is a nonexistent path within WC_DIR.
Index: subversion/tests/cmdline/stat_tests.py
===================================================================
--- subversion/tests/cmdline/stat_tests.py	(revision 32800)
+++ subversion/tests/cmdline/stat_tests.py	(working copy)
@@ -1519,51 +1519,45 @@
   # These tests correspond to use cases 1-3 in 
   # notes/tree-conflicts/use-cases.txt.
 
-  sbox.build()
-  G = os.path.join(sbox.wc_dir, 'A', 'D', 'G')
+  svntest.actions.build_greek_tree_conflicts(sbox)
+  wc_dir = sbox.wc_dir
+  G = os.path.join(wc_dir, 'A', 'D', 'G')
+  pi = os.path.join(G, 'pi')
+  rho = os.path.join(G, 'rho')
 
-  # Set up tree conflicts in wc 2
-  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
-  G2 = os.path.join(wc_dir_2, 'A', 'D', 'G')
-  pi2 = os.path.join(G2, 'pi')
-  rho2 = os.path.join(G2, 'rho')
-
-  # Update in wc 2, revealing tree conflicts
-  svntest.main.run_svn(None,'up', wc_dir_2)
-
-  # check status of G in wc 2
+  # check status of G
   expected = svntest.verify.UnorderedOutput(
-         ["C      %s\n" % G2,
-          "D      %s\n" % pi2,
-          "?      %s\n" % rho2,
+         ["C      %s\n" % G,
+          "D      %s\n" % pi,
+          "?      %s\n" % rho,
           ])
 
   svntest.actions.run_and_verify_svn(None,
                                      expected,
                                      [],
-                                     "status", G2)
+                                     "status", G)
 
-  # check status of G in wc 2, with -v
+  # check status of G, with -v
   expected = svntest.verify.UnorderedOutput(
-         ["C               2        2 jrandom      %s\n" % G2,
-          "D               2        2 jrandom      %s\n" % pi2,
-          "?                                       %s\n" % rho2,
+         ["C               2        2 jrandom      %s\n" % G,
+          "D               2        2 jrandom      %s\n" % pi,
+          "?                                       %s\n" % rho,
           ])
 
   svntest.actions.run_and_verify_svn(None,
                                      expected,
                                      [],
-                                     "status", "-v", G2)
+                                     "status", "-v", G)
 
-  # check status of G in wc 2, with -xml
-  exit_code, output, error = svntest.main.run_svn(None, 'status', G2, '--xml')
+  # check status of G, with -xml
+  exit_code, output, error = svntest.main.run_svn(None, 'status', G, '--xml')
 
   template = ["<?xml version=\"1.0\"?>\n",
               "<status>\n",
               "<target\n",
-              "   path=\"%s\">\n" % G2,
+              "   path=\"%s\">\n" % G,
               "<entry\n",
-              "   path=\"%s\">\n" % G2,
+              "   path=\"%s\">\n" % G,
               "<wc-status\n",
               "   props=\"none\"\n",
               "   tree-conflicted=\"true\"\n",  # <-- true!
Index: subversion/tests/cmdline/commit_tests.py
===================================================================
--- subversion/tests/cmdline/commit_tests.py	(revision 32800)
+++ subversion/tests/cmdline/commit_tests.py	(working copy)
@@ -2580,28 +2580,22 @@
   "tree conflicts block commit" 
   
   # Commit is not allowed in a directory containing tree conflicts.
-  # This test corresponds to use cases 1-3 in 
+  # This test corresponds to use cases 1-3 (with file victims) in 
   # notes/tree-conflicts/use-cases.txt.
 
-  sbox.build()
+  svntest.actions.build_greek_tree_conflicts(sbox)
   wc_dir = sbox.wc_dir
+  A = os.path.join(wc_dir, 'A')
+  D = os.path.join(wc_dir, 'A', 'D')
   G = os.path.join(wc_dir, 'A', 'D', 'G')
 
-  # Set up tree conflicts in wc 2
-  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
-  G2 = os.path.join(wc_dir_2, 'A', 'D', 'G')
-  D2 = os.path.join(wc_dir_2, 'A', 'D')
-  A2 = os.path.join(wc_dir_2, 'A')
-
-  # Update in wc 2, revealing tree conflicts
-  svntest.main.run_svn(None, 'up', wc_dir_2)
-
   error_re = "remains in conflict"
-  commit_fails_at_path(wc_dir_2, wc_dir_2, error_re)
-  commit_fails_at_path(A2, A2, error_re)
-  commit_fails_at_path(D2, D2, error_re)
-  commit_fails_at_path(G2, G2, error_re)
-  commit_fails_at_path(os.path.join(G2, 'pi'), G2, error_re)
+  commit_fails_at_path(wc_dir, wc_dir, error_re)
+  commit_fails_at_path(A, A, error_re)
+  commit_fails_at_path(D, D, error_re)
+  commit_fails_at_path(G, G, error_re)
+  commit_fails_at_path(os.path.join(G, 'pi'), G, error_re)
+
                                         
 def tree_conflicts_resolved(sbox):
   "tree conflicts resolved" 
@@ -2610,37 +2604,31 @@
   # This test corresponds to use cases 1-3 in 
   # notes/tree-conflicts/use-cases.txt.
 
-  sbox.build()
+  svntest.actions.build_greek_tree_conflicts(sbox)
   wc_dir = sbox.wc_dir
 
-  # Set up tree conflicts in wc 2
-  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
+  # Duplicate wc for tests
+  wc_dir_2 = sbox.add_wc_path('2')
+  svntest.actions.duplicate_dir(wc_dir, wc_dir_2)  
 
-  # Update in wc 2, revealing tree conflicts
-  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir_2)
-  
-  # Duplicate wc 2 for tests
-  wc_dir_3 =  sbox.add_wc_path('3')
-  svntest.actions.duplicate_dir(wc_dir_2, wc_dir_3)  
-
   # Resolved in directory containing tree conflicts
-  G2 = os.path.join(wc_dir_2, 'A', 'D', 'G')
-  svntest.actions.run_and_verify_svn(None, None, [], 'resolved', G2)
+  G = os.path.join(wc_dir, 'A', 'D', 'G')
+  svntest.actions.run_and_verify_svn(None, None, [], 'resolved', G)
   
-  expected_status = svntest.actions.get_virginal_state(wc_dir_2, 2)
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
   expected_status.tweak('A/D/G/pi',  status='D ')
   expected_status.remove('A/D/G/rho',
                          'A/D/G/tau')
 
-  svntest.actions.run_and_verify_status(wc_dir_2, expected_status)
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
   # Recursively resolved in parent directory -- expect same result
-  D3 = os.path.join(wc_dir_3, 'A', 'D')
-  G3 = os.path.join(wc_dir_3, 'A', 'D', 'G')
-  svntest.actions.run_and_verify_svn(None, None, [], 'resolved', D3, '-R')
+  D2 = os.path.join(wc_dir_2, 'A', 'D')
+  G2 = os.path.join(wc_dir_2, 'A', 'D', 'G')
+  svntest.actions.run_and_verify_svn(None, None, [], 'resolved', D2, '-R')
 
-  expected_status.wc_dir = wc_dir_3
-  svntest.actions.run_and_verify_status(wc_dir_3, expected_status)
+  expected_status.wc_dir = wc_dir_2
+  svntest.actions.run_and_verify_status(wc_dir_2, expected_status)
 
 
 ########################################################################
Index: subversion/tests/cmdline/info_tests.py
===================================================================
--- subversion/tests/cmdline/info_tests.py	(revision 32800)
+++ subversion/tests/cmdline/info_tests.py	(working copy)
@@ -176,30 +176,25 @@
   # These tests correspond to use cases 1-3 in
   # notes/tree-conflicts/use-cases.txt.
 
-  sbox.build()
+  svntest.actions.build_greek_tree_conflicts(sbox)
   wc_dir = sbox.wc_dir
+  G = os.path.join(wc_dir, 'A', 'D', 'G')
 
-  # Set up tree conflicts in wc 2
-  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
-  G2 = os.path.join(wc_dir_2, 'A', 'D', 'G')
+  # check info of G
+  exit_code, output, error = svntest.actions.run_and_verify_svn(None, None,
+                                                                [], 'info', G)
 
-  # Update in wc 2, revealing tree conflicts
-  svntest.main.run_svn(None, 'up', wc_dir_2)
-
-  # check info of G in wc 2
-  output, error = svntest.actions.run_and_verify_svn(None, None, [],
-                                                     'info', G2)
-
   verify_lines(output,
                ["Tree conflicts:",
-                "The update edited the file 'pi'",
-                "The update deleted the file 'rho'",
-                "The update deleted the file 'tau'",
+                "The update attempted to edit 'pi'.",
+                "The update attempted to delete 'rho'",
+                "The update attempted to delete 'tau'",
                 ])
 
-  # check XML info of G in wc 2
-  output, error = svntest.actions.run_and_verify_svn(None, None, [],
-                                                     'info', G2, '--xml')
+  # check XML info of G
+  exit_code, output, error = svntest.actions.run_and_verify_svn(None, None,
+                                                                [], 'info', G,
+                                                                '--xml')
 
   verify_xml_elements(output,
                       [('tree-conflict', {'victim'   : 'pi',

