[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r37740 - trunk/subversion/tests/cmdline

From: David Glasser <glasser_at_davidglasser.net>
Date: Mon, 18 May 2009 15:09:46 -0700

You may want to consider backporting this to 1.6 as well (I noticed
this issue when running 1.6.2).

--dave

On Fri, May 15, 2009 at 9:47 AM, Lieven Govaerts <lgo_at_mobsol.be> wrote:
> Author: lgo
> Date: Fri May 15 09:47:43 2009
> New Revision: 37740
>
> Log:
> Move test merge_fails_if_subtree_is_deleted_on_src from
> merge_tests.py to merge_authz_tests.py as this test requires
> an authz file to be written. We can't have that in
> merge_tests.py as that'd mean those tests can't be run in
> parallel anymore.
>
> Suggested by: glasser
>
> * subversion/tests/cmdline/merge_tests.py
>  (global): Move imports ...
>  (merge_fails_if_subtree_is_deleted_on_src):
>  (test_list): and this test from here...
>
> * subversion/tests/cmdline/merge_authz_tests.py
>  (global):
>  (merge_fails_if_subtree_is_deleted_on_src):
>  (test_list): ... to here.
>
> Modified:
>   trunk/subversion/tests/cmdline/merge_authz_tests.py
>   trunk/subversion/tests/cmdline/merge_tests.py
>
> Modified: trunk/subversion/tests/cmdline/merge_authz_tests.py
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/merge_authz_tests.py?pathrev=37740&r1=37739&r2=37740
> ==============================================================================
> --- trunk/subversion/tests/cmdline/merge_authz_tests.py Fri May 15 09:42:12 2009        (r37739)
> +++ trunk/subversion/tests/cmdline/merge_authz_tests.py Fri May 15 09:47:43 2009        (r37740)
> @@ -31,10 +31,12 @@ Skip = svntest.testcase.Skip
>  SkipUnless = svntest.testcase.SkipUnless
>
>  from merge_tests import set_up_branch
> -
> +from merge_tests import expected_merge_output
>  from svntest.main import SVN_PROP_MERGEINFO
>  from svntest.main import write_restrictive_svnserve_conf
>  from svntest.main import write_authz_file
> +from svntest.main import is_ra_type_dav
> +from svntest.main import is_ra_type_svn
>  from svntest.main import server_has_mergeinfo
>  from svntest.actions import fill_file_with_lines
>  from svntest.actions import make_conflict_marker_text
> @@ -356,7 +358,6 @@ def mergeinfo_and_skipped_paths(sbox):
>                                        None, None, None, None,
>                                        None, 1, 0, '-c5', '-c8')
>
> -
>   # Test issue #2829 'Improve handling for skipped paths encountered
>   # during a merge'
>
> @@ -408,6 +409,125 @@ def mergeinfo_and_skipped_paths(sbox):
>                                        None, None, None, None,
>                                        None, 1, 0)
>
> +def merge_fails_if_subtree_is_deleted_on_src(sbox):
> +  "merge fails if subtree is deleted on src"
> +
> +  ## See http://subversion.tigris.org/issues/show_bug.cgi?id=2876. ##
> +
> +  # Create a WC
> +  sbox.build()
> +  wc_dir = sbox.wc_dir
> +
> +  if is_ra_type_svn() or is_ra_type_dav():
> +    write_authz_file(sbox, {"/" : "* = rw",
> +                            "/unrelated" : ("* =\n" +
> +                             svntest.main.wc_author2 + " = rw")})
> +
> +  # Some paths we'll care about
> +  Acopy_path = os.path.join(wc_dir, 'A_copy')
> +  gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
> +  Acopy_gamma_path = os.path.join(wc_dir, 'A_copy', 'D', 'gamma')
> +  Acopy_D_path = os.path.join(wc_dir, 'A_copy', 'D')
> +  A_url = sbox.repo_url + '/A'
> +  Acopy_url = sbox.repo_url + '/A_copy'
> +
> +  # Contents to be added to 'gamma'
> +  new_content = "line1\nline2\nline3\nline4\nline5\n"
> +
> +  svntest.main.file_write(gamma_path, new_content)
> +
> +  # Create expected output tree for commit
> +  expected_output = wc.State(wc_dir, {
> +    'A/D/gamma' : Item(verb='Sending'),
> +    })
> +
> +  # Create expected status tree for commit
> +  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
> +  expected_status.tweak('A/D/gamma', wc_rev=2)
> +
> +  # Commit the new content
> +  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
> +                                        expected_status, None, wc_dir)
> +
> +  svntest.actions.run_and_verify_svn(None, None, [], 'cp', A_url, Acopy_url,
> +                                     '-m', 'create a new copy of A')
> +
> +  # Update working copy
> +  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
> +
> +  svntest.main.file_substitute(gamma_path, "line1", "this is line1")
> +  # Create expected output tree for commit
> +  expected_output = wc.State(wc_dir, {
> +    'A/D/gamma' : Item(verb='Sending'),
> +    })
> +
> +  # Create expected status tree for commit
> +  expected_status.tweak(wc_rev=3)
> +  expected_status.tweak('A/D/gamma', wc_rev=4)
> +  expected_status.add({
> +    'A_copy'          : Item(status='  ', wc_rev=3),
> +    'A_copy/B'        : Item(status='  ', wc_rev=3),
> +    'A_copy/B/lambda' : Item(status='  ', wc_rev=3),
> +    'A_copy/B/E'      : Item(status='  ', wc_rev=3),
> +    'A_copy/B/E/alpha': Item(status='  ', wc_rev=3),
> +    'A_copy/B/E/beta' : Item(status='  ', wc_rev=3),
> +    'A_copy/B/F'      : Item(status='  ', wc_rev=3),
> +    'A_copy/mu'       : Item(status='  ', wc_rev=3),
> +    'A_copy/C'        : Item(status='  ', wc_rev=3),
> +    'A_copy/D'        : Item(status='  ', wc_rev=3),
> +    'A_copy/D/gamma'  : Item(status='  ', wc_rev=3),
> +    'A_copy/D/G'      : Item(status='  ', wc_rev=3),
> +    'A_copy/D/G/pi'   : Item(status='  ', wc_rev=3),
> +    'A_copy/D/G/rho'  : Item(status='  ', wc_rev=3),
> +    'A_copy/D/G/tau'  : Item(status='  ', wc_rev=3),
> +    'A_copy/D/H'      : Item(status='  ', wc_rev=3),
> +    'A_copy/D/H/chi'  : Item(status='  ', wc_rev=3),
> +    'A_copy/D/H/omega': Item(status='  ', wc_rev=3),
> +    'A_copy/D/H/psi'  : Item(status='  ', wc_rev=3),
> +    })
> +
> +  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
> +                                        expected_status, None, wc_dir)
> +
> +  # Delete A/D/gamma from working copy
> +  svntest.actions.run_and_verify_svn(None, None, [], 'delete', gamma_path)
> +  # Create expected output tree for commit
> +  expected_output = wc.State(wc_dir, {
> +    'A/D/gamma' : Item(verb='Deleting'),
> +    })
> +
> +  expected_status.remove('A/D/gamma')
> +
> +  svntest.actions.run_and_verify_commit(wc_dir,
> +                                        expected_output,
> +                                        expected_status,
> +                                        None,
> +                                        wc_dir, wc_dir)
> +  svntest.actions.run_and_verify_svn(None, expected_merge_output([[3,4]],
> +                                     'U    ' + Acopy_gamma_path + '\n'),
> +                                     [], 'merge', '-r1:4',
> +                                     A_url + '/D/gamma' + '@4',
> +                                     Acopy_gamma_path)
> +
> +  # r6: create an empty (unreadable) commit.
> +  # Empty or unreadable revisions used to crash a svn 1.6+ client when
> +  # used with a 1.5 server:
> +  # http://svn.haxx.se/dev/archive-2009-04/0476.shtml
> +  svntest.main.run_svn(None, 'mkdir', sbox.repo_url + '/unrelated',
> +                       '--username', svntest.main.wc_author2,
> +                       '-m', 'creating a rev with no paths.')
> +
> +  # This merge causes a tree conflict. Since the result of the previous
> +  # merge of A/D/gamma into A_copy/D has not yet been committed, it is
> +  # considered a local modification of A_Copy/D/gamma by the following
> +  # merge. A delete merged ontop of a modified file is a tree conflict.
> +  # See notes/tree-conflicts/detection.txt
> +  svntest.actions.run_and_verify_svn(None, expected_merge_output([[6], [3,6]],
> +                                     ['D    ' + Acopy_gamma_path + '\n',
> +                                     'C    ' + Acopy_D_path + '\n']),
> +                                     [], 'merge', '-r1:6', '--force',
> +                                     A_url, Acopy_path)
> +
>  ########################################################################
>  # Run the tests
>
> @@ -417,6 +537,8 @@ test_list = [ None,
>               SkipUnless(Skip(mergeinfo_and_skipped_paths,
>                               svntest.main.is_ra_type_file),
>                          svntest.main.server_has_mergeinfo),
> +              SkipUnless(merge_fails_if_subtree_is_deleted_on_src,
> +                         server_has_mergeinfo),
>              ]
>
>  if __name__ == '__main__':
>
> Modified: trunk/subversion/tests/cmdline/merge_tests.py
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/merge_tests.py?pathrev=37740&r1=37739&r2=37740
> ==============================================================================
> --- trunk/subversion/tests/cmdline/merge_tests.py       Fri May 15 09:42:12 2009        (r37739)
> +++ trunk/subversion/tests/cmdline/merge_tests.py       Fri May 15 09:47:43 2009        (r37740)
> @@ -32,9 +32,6 @@ SkipUnless = svntest.testcase.SkipUnless
>
>  from svntest.main import SVN_PROP_MERGEINFO
>  from svntest.main import server_has_mergeinfo
> -from svntest.main import write_authz_file
> -from svntest.main import is_ra_type_dav
> -from svntest.main import is_ra_type_svn
>  from svntest.actions import fill_file_with_lines
>  from svntest.actions import make_conflict_marker_text
>  from svntest.actions import inject_conflict_into_expected_state
> @@ -7002,124 +6999,6 @@ def merge_with_depth_files(sbox):
>                                        None, None, None, None, None, 1, 1,
>                                        '--depth', 'files')
>
> -def merge_fails_if_subtree_is_deleted_on_src(sbox):
> -  "merge fails if subtree is deleted on src"
> -
> -  ## See http://subversion.tigris.org/issues/show_bug.cgi?id=2876. ##
> -
> -  # Create a WC
> -  sbox.build()
> -  wc_dir = sbox.wc_dir
> -
> -  if is_ra_type_svn() or is_ra_type_dav():
> -    write_authz_file(sbox, {"/" : "* = rw",
> -                            "/unrelated" : ("* =\n" +
> -                             svntest.main.wc_author2 + " = rw")})
> -
> -  # Some paths we'll care about
> -  Acopy_path = os.path.join(wc_dir, 'A_copy')
> -  gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
> -  Acopy_gamma_path = os.path.join(wc_dir, 'A_copy', 'D', 'gamma')
> -  Acopy_D_path = os.path.join(wc_dir, 'A_copy', 'D')
> -  A_url = sbox.repo_url + '/A'
> -  Acopy_url = sbox.repo_url + '/A_copy'
> -
> -  # Contents to be added to 'gamma'
> -  new_content = "line1\nline2\nline3\nline4\nline5\n"
> -
> -  svntest.main.file_write(gamma_path, new_content)
> -
> -  # Create expected output tree for commit
> -  expected_output = wc.State(wc_dir, {
> -    'A/D/gamma' : Item(verb='Sending'),
> -    })
> -
> -  # Create expected status tree for commit
> -  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
> -  expected_status.tweak('A/D/gamma', wc_rev=2)
> -
> -  # Commit the new content
> -  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
> -                                        expected_status, None, wc_dir)
> -
> -  svntest.actions.run_and_verify_svn(None, None, [], 'cp', A_url, Acopy_url,
> -                                     '-m', 'create a new copy of A')
> -
> -  # Update working copy
> -  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
> -
> -  svntest.main.file_substitute(gamma_path, "line1", "this is line1")
> -  # Create expected output tree for commit
> -  expected_output = wc.State(wc_dir, {
> -    'A/D/gamma' : Item(verb='Sending'),
> -    })
> -
> -  # Create expected status tree for commit
> -  expected_status.tweak(wc_rev=3)
> -  expected_status.tweak('A/D/gamma', wc_rev=4)
> -  expected_status.add({
> -    'A_copy'          : Item(status='  ', wc_rev=3),
> -    'A_copy/B'        : Item(status='  ', wc_rev=3),
> -    'A_copy/B/lambda' : Item(status='  ', wc_rev=3),
> -    'A_copy/B/E'      : Item(status='  ', wc_rev=3),
> -    'A_copy/B/E/alpha': Item(status='  ', wc_rev=3),
> -    'A_copy/B/E/beta' : Item(status='  ', wc_rev=3),
> -    'A_copy/B/F'      : Item(status='  ', wc_rev=3),
> -    'A_copy/mu'       : Item(status='  ', wc_rev=3),
> -    'A_copy/C'        : Item(status='  ', wc_rev=3),
> -    'A_copy/D'        : Item(status='  ', wc_rev=3),
> -    'A_copy/D/gamma'  : Item(status='  ', wc_rev=3),
> -    'A_copy/D/G'      : Item(status='  ', wc_rev=3),
> -    'A_copy/D/G/pi'   : Item(status='  ', wc_rev=3),
> -    'A_copy/D/G/rho'  : Item(status='  ', wc_rev=3),
> -    'A_copy/D/G/tau'  : Item(status='  ', wc_rev=3),
> -    'A_copy/D/H'      : Item(status='  ', wc_rev=3),
> -    'A_copy/D/H/chi'  : Item(status='  ', wc_rev=3),
> -    'A_copy/D/H/omega': Item(status='  ', wc_rev=3),
> -    'A_copy/D/H/psi'  : Item(status='  ', wc_rev=3),
> -    })
> -
> -  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
> -                                        expected_status, None, wc_dir)
> -
> -  # Delete A/D/gamma from working copy
> -  svntest.actions.run_and_verify_svn(None, None, [], 'delete', gamma_path)
> -  # Create expected output tree for commit
> -  expected_output = wc.State(wc_dir, {
> -    'A/D/gamma' : Item(verb='Deleting'),
> -    })
> -
> -  expected_status.remove('A/D/gamma')
> -
> -  svntest.actions.run_and_verify_commit(wc_dir,
> -                                        expected_output,
> -                                        expected_status,
> -                                        None,
> -                                        wc_dir, wc_dir)
> -  svntest.actions.run_and_verify_svn(None, expected_merge_output([[3,4]],
> -                                     'U    ' + Acopy_gamma_path + '\n'),
> -                                     [], 'merge', '-r1:4',
> -                                     A_url + '/D/gamma' + '@4',
> -                                     Acopy_gamma_path)
> -
> -  # r6: create an empty (unreadable) commit.
> -  # Empty or unreadable revisions used to crash a svn 1.6+ client when
> -  # used with a 1.5 server:
> -  # http://svn.haxx.se/dev/archive-2009-04/0476.shtml
> -  svntest.main.run_svn(None, 'mkdir', sbox.repo_url + '/unrelated',
> -                       '--username', svntest.main.wc_author2,
> -                       '-m', 'creating a rev with no paths.')
> -
> -  # This merge causes a tree conflict. Since the result of the previous
> -  # merge of A/D/gamma into A_copy/D has not yet been committed, it is
> -  # considered a local modification of A_Copy/D/gamma by the following
> -  # merge. A delete merged ontop of a modified file is a tree conflict.
> -  # See notes/tree-conflicts/detection.txt
> -  svntest.actions.run_and_verify_svn(None, expected_merge_output([[6], [3,6]],
> -                                     ['D    ' + Acopy_gamma_path + '\n',
> -                                     'C    ' + Acopy_D_path + '\n']),
> -                                     [], 'merge', '-r1:6', '--force',
> -                                     A_url, Acopy_path)
>
>   # Test for issue #2976 Subtrees can lose non-inheritable ranges.
>   #
> @@ -15706,8 +15585,6 @@ test_list = [ None,
>                          server_has_mergeinfo),
>               SkipUnless(merge_with_depth_files,
>                          server_has_mergeinfo),
> -              SkipUnless(merge_fails_if_subtree_is_deleted_on_src,
> -                         server_has_mergeinfo),
>               SkipUnless(merge_away_subtrees_noninheritable_ranges,
>                          server_has_mergeinfo),
>               SkipUnless(merge_to_sparse_directories,
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=2272694
>

-- 
glasser_at_davidglasser.net | langtonlabs.org | flickr.com/photos/glasser/
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2303941
Received on 2009-05-19 00:10:13 CEST

This is an archived mail posted to the Subversion Dev mailing list.