[PATCH] Add XFailing test for #2371 update cannot replace svn:external with versioned item

Daniel Näslund <[email protected]> Thu, 10 Dec 2009 10:36:44 +0100
Newsgroups gmane.comp.version-control.subversion.devel,gmane.comp.version-control.subversion.rapidsvn.devel
Message-ID <20091210093643.GA6037@daniel-laptop>
On Wed, Dec 09, 2009 at 12:22:38PM -0800, Mike Dixon wrote:
> Daniel Näslund wrote:
> > On Wed, Dec 09, 2009 at 06:57:40PM +0100, Alexander Kitaev wrote:
> >> There is a serious bug in 1.6.6 (and in 1.6.5), external directory is
> >> not deleted when svn:externals property is deleted.
> >>
> >> That means that subsequent updates from a certain revision without any
> >> modifications made to the target working copy will fail:
> >>
> >> svn up -rN   (svn:external set to "URL ext")
> >>
> >> svn up -rN+1 (svn:external deleted)
> >>
> >> svn up -rN+2 ("ext" directory added) - will fail because "ext" has not
> >> been deleted!
> >>
> >>
> >> Attached script reproduces the problem.
> >  
> > Could this be issue 3351?
> > http://subversion.tigris.org/issues/show_bug.cgi?id=3351
> 
> Sounds like issue 2371 to me:
> http://subversion.tigris.org/issues/show_bug.cgi?id=2371

Yeah, I agree. 

[[[
Add XFailing test for #2371, update cannot replace svn:external with
versioned item.

* subversion/tests/cmdline/external_tests.py
  (update_replace_external_with_versioned_item): In one update both a
    svn:external dir is removed and added as a regular versioned item.
  (test_list): Add the test with XFail set.

Patch by: Daniel Näslund <daniel{_AT_}longitudo.com
]]]

As pointed out in the issue tracker, a design decision was to postpone
the handling of externals to after the regular update. Not sure if it's
easily fixed. I would assume that it needs some major rearrangemant of
code.

Daniel
issue_2371_test.diff (text/x-diff, 2.4 KB)
Index: subversion/tests/cmdline/externals_tests.py
===================================================================
--- subversion/tests/cmdline/externals_tests.py	(revision 889114)
+++ subversion/tests/cmdline/externals_tests.py	(arbetskopia)
@@ -1315,7 +1315,49 @@
                                         None, None, None, None, None,
                                         True)
 
+# Issue #2371
+def update_replace_external_with_versioned_item(sbox):
+  "update to replace an external with versioned item"
+  
+  external_url_for = externals_test_setup(sbox)
+  wc_dir           = sbox.wc_dir
+  
+  other_wc_dir   = sbox.add_wc_path('other')
+  repo_url       = sbox.repo_url
 
+  # Checkout two working copies.
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'checkout',
+                                     repo_url, wc_dir)
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'checkout',
+                                     repo_url, other_wc_dir)
+
+  # Remove svn:externals on /A/C/
+  dir_A_C = os.path.join(wc_dir, "A/C");
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'pd',
+                                     'svn:externals', dir_A_C)
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
+                                     '-m', 'log msg', '--quiet', wc_dir)
+
+  # Create new dir named as removed external dir
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'mkdir',
+                                     '-m', 'log msg',
+                                     os.path.join(repo_url, 'A/C/exdir_G'))
+                                     
+  # Update other working copy, see if we have a new versioned dir
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', other_wc_dir)
+
+  expected_existing_paths = [
+    os.path.join(other_wc_dir, "A", "C", "exdir_G"),
+  ]
+  probe_paths_exist(expected_existing_paths)
+
 #----------------------------------------------------------------------
 
 # Issue #3351.
@@ -1481,6 +1523,7 @@
               external_into_path_with_spaces,
               binary_file_externals,
               XFail(update_lose_file_external),
+              XFail(update_replace_external_with_versioned_item), 
               XFail(switch_relative_external),
               export_sparse_wc_with_externals,
               relegate_external,