You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2013/02/13 20:17:47 UTC

svn commit: r1445870 - /subversion/trunk/subversion/tests/cmdline/merge_authz_tests.py

Author: pburba
Date: Wed Feb 13 19:17:46 2013
New Revision: 1445870

URL: http://svn.apache.org/r1445870
Log:
Add test for issue #4319 'faulty merge notifications when target subtree
unreadable'.

*subversion/tests/cmdline/merge_authz_tests.py

  (merge_notifications_and_authz_skips): New.

  (test_list): Add merge_notifications_and_authz_skips.

Modified:
    subversion/trunk/subversion/tests/cmdline/merge_authz_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/merge_authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_authz_tests.py?rev=1445870&r1=1445869&r2=1445870&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_authz_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_authz_tests.py Wed Feb 13 19:17:46 2013
@@ -737,6 +737,133 @@ def reintegrate_fails_if_no_root_access(
                                        None, True, True,
                                        '--reintegrate', A_path)
 
+#----------------------------------------------------------------------
+# Test for issue #4319 'faulty merge notifications when target subtree
+# unreadable'.
+@SkipUnless(svntest.main.server_has_mergeinfo)
+@Skip(svntest.main.is_ra_type_file)
+@Issue(4319)
+@XFail()
+def merge_notifications_and_authz_skips(sbox):
+  "merge notifications when target subtree unreadable"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  deep_source_tree = sbox.ospath('A/C/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z')
+  deep_source_file = sbox.ospath('A/C/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/nu')
+  branch_root = sbox.ospath('branch')
+
+  # r2 - branch ^/A to ^/branch
+  sbox.simple_copy('A', 'branch')
+  sbox.simple_commit()
+  sbox.simple_update()
+
+  # r3 - Add a deep subtree
+  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir',
+                                     deep_source_tree, '--parents')
+  svntest.main.file_write(deep_source_file, "This is the file 'nu'.\n")
+  svntest.actions.run_and_verify_svn(None, None, [], 'add', deep_source_file)
+  sbox.simple_commit()
+
+  # 
+  # Create a restrictive authz where part of the merge source and part
+  # of the target are inaccesible.
+  sbox.simple_update(revision=0)
+  write_restrictive_svnserve_conf(sbox.repo_dir)
+  write_authz_file(sbox, {"/" : svntest.main.wc_author +"=rw",
+                          # Make a subtree in the merge target inaccessible.
+                          "/branch/C" : svntest.main.wc_author + "=",
+                          })
+  sbox.simple_update()
+
+  expected_output = wc.State(branch_root, {
+    })
+  expected_mergeinfo_output = wc.State(branch_root, {
+    ''  : Item(status=' U'),
+    })
+  expected_elision_output = wc.State(branch_root, {
+    })
+  expected_status = wc.State(branch_root, {
+    ''          : Item(status=' M', wc_rev=3),
+    'D/H/chi'   : Item(status='  ', wc_rev=3),
+    'D/H/omega' : Item(status='  ', wc_rev=3),
+    'D/H/psi'   : Item(status='  ', wc_rev=3),
+    'D/H'       : Item(status='  ', wc_rev=3),
+    'D/gamma'   : Item(status='  ', wc_rev=3),
+    'D'         : Item(status='  ', wc_rev=3),
+    'D/G'       : Item(status='  ', wc_rev=3),
+    'D/G/pi'    : Item(status='  ', wc_rev=3),
+    'D/G/rho'   : Item(status='  ', wc_rev=3),
+    'D/G/tau'   : Item(status='  ', wc_rev=3),
+    'B/lambda'  : Item(status='  ', wc_rev=3),
+    'B/E'       : Item(status='  ', wc_rev=3),
+    'B/E/alpha' : Item(status='  ', wc_rev=3),
+    'B/E/beta'  : Item(status='  ', wc_rev=3),
+    'B/F'       : Item(status='  ', wc_rev=3),
+    'B'         : Item(status='  ', wc_rev=3),
+    'mu'        : Item(status='  ', wc_rev=3),
+    })
+  expected_disk = wc.State('', {
+    ''          : Item(props={SVN_PROP_MERGEINFO : '/A:2-3*'}),
+    'D/H/omega' : Item("This is the file 'omega'.\n"),
+    'D/H/chi'   : Item("This is the file 'chi'.\n"),
+    'D/H/psi'   : Item("This is the file 'psi'.\n"),
+    'D/H'       : Item(),
+    'D/gamma'   : Item("This is the file 'gamma'.\n"),
+    'D'         : Item(),
+    'D/G'       : Item(),
+    'D/G/pi'    : Item("This is the file 'pi'.\n"),
+    'D/G/rho'   : Item("This is the file 'rho'.\n"),
+    'D/G/tau'   : Item("This is the file 'tau'.\n"),
+    'B/lambda'  : Item("This is the file 'lambda'.\n"),
+    'B/E'       : Item(),
+    'B/E/alpha' : Item("This is the file 'alpha'.\n"),
+    'B/E/beta'  : Item("This is the file 'beta'.\n"),
+    'B/F'       : Item(),
+    'B'         : Item(),
+    'mu'        : Item("This is the file 'mu'.\n"),
+    })
+  expected_skip = wc.State(branch_root,
+                           {'C' : Item(verb='Skipped missing target')})
+  # This fails because notifications for all the added subtrees under
+  # branch/C occur:
+  #
+  #   >svn merge ^^/A branch -r1:3
+  #   Skipped missing target: 'branch\C'
+  #      A branch\C\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z\nu
+  #      A branch\C\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+  #      A branch\C\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y
+  #      A branch\C\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X
+  #      A branch\C\J\K\L\M\N\O\P\Q\R\S\T\U\V\W
+  #      A branch\C\J\K\L\M\N\O\P\Q\R\S\T\U\V
+  #      A branch\C\J\K\L\M\N\O\P\Q\R\S\T\U
+  #      A branch\C\J\K\L\M\N\O\P\Q\R\S\T
+  #      A branch\C\J\K\L\M\N\O\P\Q\R\S
+  #      A branch\C\J\K\L\M\N\O\P\Q\R
+  #      A branch\C\J\K\L\M\N\O\P\Q
+  #      A branch\C\J\K\L\M\N\O\P
+  #      A branch\C\J\K\L\M\N\O
+  #      A branch\C\J\K\L\M\N
+  #      A branch\C\J\K\L\M
+  #      A branch\C\J\K\L
+  #      A branch\C\J\K
+  #      A branch\C\J
+  #   --- Recording mergeinfo for merge of r2 through r3 into 'branch':
+  #    U   branch
+  #   Summary of conflicts:
+  #     Skipped paths: 1
+  svntest.actions.run_and_verify_merge(branch_root, 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)
+
 ########################################################################
 # Run the tests
 
@@ -746,6 +873,7 @@ test_list = [ None,
               mergeinfo_and_skipped_paths,
               merge_fails_if_subtree_is_deleted_on_src,
               reintegrate_fails_if_no_root_access,
+              merge_notifications_and_authz_skips,
              ]
 serial_only = True