Index: merge_tests.py
===================================================================
--- merge_tests.py	(Revision 33177)
+++ merge_tests.py	(Arbeitskopie)
@@ -13934,10 +13934,119 @@
                expected_status,
                expected_skip,
              ) ], False)
+#----------------------------------------------------------------------
 
+# Merging a directory add should only mark the directory as A+
+# but not all its children too. See issue #1962.
 
+def merge_dir_add(sbox):
+  "merge a dirctory add shouldn't mark children added"
+  merge_dir_add2(sbox, False)
 
+def merge_dir_add2(sbox, useCopy):
+  "merge a dirctory add shouldn't mark children added"
 
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  svn_commit.repo_rev = 1
+
+  Q1_path = os.path.join(wc_dir, 'Q1')
+  Q2_path = os.path.join(wc_dir, 'Q2')
+  R_Q1_path = os.path.join(Q1_path, 'R')
+  R_Q2_path = os.path.join(Q2_path, 'R')
+  file1_Q1_path = os.path.join(Q1_path, 'R', 'file1')
+  file2_Q1_path = os.path.join(Q1_path, 'R', 'file2')
+  file1_Q2_path = os.path.join(Q2_path, 'R', 'file1')
+  
+  svntest.main.run_svn(None, 'mkdir', Q1_path)
+  svntest.main.run_svn(None, 'mkdir', Q2_path)
+  svn_commit(wc_dir)
+  svntest.main.run_svn(None, 'update', wc_dir)
+  
+  os.mkdir(R_Q1_path)
+  fill_file_with_lines(file1_Q1_path, 1)
+  fill_file_with_lines(file2_Q1_path, 1)
+  svntest.main.run_svn(None, 'add', R_Q1_path)
+  s_rev_add = svn_commit(wc_dir)
+  svntest.main.run_svn(None, 'update', wc_dir)
+
+  expected_output = wc.State(Q2_path, {
+    'R'       : Item(status='A '),
+    })
+  expected_status = wc.State(Q2_path, {
+    ''        : Item(status=' M', wc_rev=s_rev_add),
+    'R'       : Item(status='A ', copied='+', wc_rev='-'),
+    'R/file1' : Item(status='  ', copied='+', wc_rev='-'),
+    'R/file2' : Item(status='  ', copied='+', wc_rev='-'),
+    })
+  expected_disk = wc.State('', {
+    'R'       : Item(),
+    'R/file1' : Item("This is line 1 in 'file1'.\n"
+                   + "This is line 2 in 'file1'.\n"
+                   + "This is line 3 in 'file1'.\n"),
+    'R/file2' : Item("This is line 1 in 'file2'.\n"
+                   + "This is line 2 in 'file2'.\n"
+                   + "This is line 3 in 'file2'.\n"),
+    })
+  expected_skip = wc.State('', { })
+
+  if useCopy:
+    # The following lines, that do more or less the same as the merge,
+    # but with a copy and will pass...
+
+    svntest.actions.run_and_verify_svn(None, ["A         " + R_Q2_path + "\n"], [], 'cp', R_Q1_path, Q2_path)
+    svn_propset(SVN_PROP_MERGEINFO, '/Q1/R:' + str(s_rev_add), Q2_path)
+    svntest.actions.run_and_verify_status(Q2_path, expected_status)
+    svntest.actions.verify_disk(Q2_path, expected_disk)
+  else:
+    # Do the merge...
+    svntest.actions.run_and_verify_merge(Q2_path, s_rev_add-1, s_rev_add,
+                                         sbox.repo_url + '/Q1',
+                                         expected_output,
+                                         expected_disk,
+                                         expected_status,
+                                         expected_skip,
+                                         None, None, None, None,
+                                         None, False)
+
+  # To remove Q2/R/file1: revert should do nothing, but delete should
+  # delete the file so that is is not included in the rev when committing
+  svntest.actions.run_and_verify_svn(None, [], [], 'revert', file1_Q2_path)
+  svntest.actions.run_and_verify_svn(None, ["D         " + file1_Q2_path + "\n"], [], 'delete', file1_Q2_path)
+
+  # Verify the wc after revert and delete
+  expected_status.tweak('R/file1', status='D ',  wc_rev='3', copied=None)
+  expected_disk.remove('R/file1')
+  svntest.actions.run_and_verify_status(Q2_path, expected_status)
+  svntest.actions.verify_disk(Q2_path, expected_disk)
+
+  # Commit  
+  expected_output = wc.State(Q2_path, {
+    ''                  : Item(verb='Sending'),
+    'R'                 : Item(verb='Adding'),
+    'R/file1'           : Item(verb='Deleting'),
+    })
+  expected_status.remove('R/file1')
+  expected_status.tweak(status='  ', copied=None, wc_rev=svn_commit.repo_rev+1)
+  svntest.actions.run_and_verify_commit(Q2_path,
+                                        expected_output,
+                                        expected_status,
+                                        None,
+                                        Q2_path)
+  svn_commit.repo_rev += 1
+
+  # Check contents of repository
+  expected_output = [
+    "R/\n", 
+    "R/file2\n",
+    ]
+  svntest.actions.run_and_verify_svn(None, expected_output, [], 'ls', '-R',
+                                     Q2_path)
+
+
+
+
+
 ########################################################################
 # Run the tests
 
@@ -14137,6 +14246,7 @@
               tree_conflicts_on_merge_no_local_ci_5_1,
               tree_conflicts_on_merge_no_local_ci_5_2,
               tree_conflicts_on_merge_no_local_ci_6,
+              XFail(merge_dir_add),
              ]
 
 if __name__ == '__main__':
