subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1591139 - in /subversion/branches/1.8.x: ./ STATUS subversion/libsvn_client/export.c subversion/tests/cmdline/export_tests.py
Date Tue, 29 Apr 2014 23:00:23 GMT
Author: breser
Date: Tue Apr 29 23:00:23 2014
New Revision: 1591139

URL: http://svn.apache.org/r1591139
Log:
Merge the r1575525 group from trunk:

 * r1575525, r1575915
   Resolve issue #4427: File externals can't be exported.
   Justification:
     File externals 'are just files', so why should they be discriminated
     by export?
   Notes:
     r1575525 resolves the most important issues, but in some cases still
     doesn't allow exporting file externals. r1575915 simplifies the fix and
     resolves a few remaining issues.
   Votes:
     +1: rhuijben, breser, philip


Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/libsvn_client/export.c
    subversion/branches/1.8.x/subversion/tests/cmdline/export_tests.py

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1575525,1575915

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1591139&r1=1591138&r2=1591139&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Tue Apr 29 23:00:23 2014
@@ -181,18 +181,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1575525, r1575915
-   Resolve issue #4427: File externals can't be exported.
-   Justification:
-     File externals 'are just files', so why should they be discriminated
-     by export?
-   Notes:
-     r1575525 resolves the most important issues, but in some cases still
-     doesn't allow exporting file externals. r1575915 simplifies the fix and
-     resolves a few remaining issues.
-   Votes:
-     +1: rhuijben, breser, philip
-
  * r1531014, r1532316, r1536350, r1536383, r1536464, r1536488, r1567204, r1567228
    Fix working copy database inconsistency on certain move scenarios,
    including those described in issue #4437 "Deleting a moved file can maintain a

Modified: subversion/branches/1.8.x/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_client/export.c?rev=1591139&r1=1591138&r2=1591139&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_client/export.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_client/export.c Tue Apr 29 23:00:23 2014
@@ -267,7 +267,9 @@ export_node(void *baton,
                                                       scratch_pool));
     }
 
-  if (status->file_external)
+  /* Skip file externals if they are a descendant of the export,
+     BUT NOT if we are explictly exporting the file external. */
+  if (status->file_external && strcmp(eib->origin_abspath, local_abspath) !=
0)
     return SVN_NO_ERROR;
 
   /* Produce overwrite errors for the export root */
@@ -1587,3 +1589,4 @@ svn_client_export5(svn_revnum_t *result_
 
   return SVN_NO_ERROR;
 }
+

Modified: subversion/branches/1.8.x/subversion/tests/cmdline/export_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/tests/cmdline/export_tests.py?rev=1591139&r1=1591138&r2=1591139&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/branches/1.8.x/subversion/tests/cmdline/export_tests.py Tue Apr 29 23:00:23
2014
@@ -964,6 +964,114 @@ def export_custom_keywords(sbox):
   if open(export_file).read() != ''.join(alpha_content):
     raise svntest.Failure("wrong keyword expansion")
 
+@Issue(4427)
+def export_file_external(sbox):
+  "export file external from WC and URL"
+  sbox.build()
+
+  wc_dir = sbox.wc_dir
+
+  # Set 'svn:externals' property in 'A/C' to 'A/B/E/alpha'(file external),
+  C_path = os.path.join(wc_dir, 'A', 'C')
+  externals_prop = "^/A/B/E/alpha exfile_alpha"
+
+  tmp_f = sbox.get_tempname('prop')
+  svntest.main.file_append(tmp_f, externals_prop)
+  svntest.main.run_svn(None, 'ps', '-F', tmp_f, 'svn:externals', C_path)
+  svntest.main.run_svn(None,'ci', '-m', 'log msg', '--quiet', C_path)
+
+  # Update the working copy to receive file external
+  svntest.main.run_svn(None, 'up', wc_dir)
+
+  # Update the expected disk tree to include the external.
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.add({
+      'A/C/exfile_alpha'  : Item("This is the file 'alpha'.\n"),
+      })
+
+  # Export from URL
+  export_target = sbox.add_wc_path('export_url')
+  expected_output = svntest.main.greek_state.copy()
+  expected_output.add({
+      'A/C/exfile_alpha'  : Item("This is the file 'alpha'.\r"),
+      })
+  expected_output.wc_dir = export_target
+  expected_output.desc[''] = Item()
+  expected_output.tweak(contents=None, status='A ')
+  svntest.actions.run_and_verify_export(sbox.repo_url,
+                                        export_target,
+                                        expected_output,
+                                        expected_disk)
+
+  # Export from WC
+  export_target = sbox.add_wc_path('export_wc')
+  expected_output = svntest.main.greek_state.copy()
+  expected_output.add({
+      'A/C/exfile_alpha'  : Item("This is the file 'alpha'.\r"),
+      })
+  expected_output.wc_dir = export_target
+  expected_output.desc['A'] = Item()
+  expected_output.tweak(contents=None, status='A ')
+  svntest.actions.run_and_verify_export(wc_dir,
+                                        export_target,
+                                        expected_output,
+                                        expected_disk)
+
+@Issue(4427)
+def export_file_externals2(sbox):
+  "exporting file externals"
+  
+  sbox.build()
+  sbox.simple_mkdir('DIR', 'DIR2')
+  
+  sbox.simple_propset('svn:externals', '^/iota file', 'DIR')
+  sbox.simple_propset('svn:externals', '^/DIR TheDir', 'DIR2')
+  sbox.simple_commit()
+  sbox.simple_update()
+  
+  tmp = sbox.add_wc_path('tmp')
+  os.mkdir(tmp)
+  
+  expected_output = svntest.wc.State(tmp, {
+    'file'          : Item(status='A '),
+  })
+  expected_disk = svntest.wc.State('', {
+    'file': Item(contents="This is the file 'iota'.\n")
+  })
+  # Fails in 1.8.8 and r1575909.
+  # Direct export of file external was just skipped
+  svntest.actions.run_and_verify_export(sbox.ospath('DIR/file'),
+                                        tmp,
+                                        expected_output,
+                                        expected_disk)
+  
+  expected_output = svntest.wc.State(tmp, {
+    'DIR/file'           : Item(status='A '),
+  })
+  expected_disk = svntest.wc.State('', {
+    'file': Item(contents="This is the file 'iota'.\n")
+  })
+  # Fails in 1.8.8 (doesn't export file), passes in r1575909
+  svntest.actions.run_and_verify_export(sbox.ospath('DIR'),
+                                        os.path.join(tmp, 'DIR'),
+                                        expected_output,
+                                        expected_disk)
+                                        
+  expected_output = svntest.wc.State(tmp, {
+    'DIR2/TheDir/file' : Item(status='A '),
+  })
+  expected_disk = svntest.wc.State('', {
+    'TheDir'      : Item(),
+    'TheDir/file' : Item(contents="This is the file 'iota'.\n")
+  })
+  # Fails in 1.8.8 (doesn't export anything),
+  # Fails in r1575909 (exports file twice; once as file; once as external)
+  svntest.actions.run_and_verify_export(sbox.ospath('DIR2'),
+                                        os.path.join(tmp, 'DIR2'),
+                                        expected_output,
+                                        expected_disk)
+
+
 ########################################################################
 # Run the tests
 
@@ -998,6 +1106,8 @@ test_list = [ None,
               export_to_current_dir,
               export_file_overwrite_with_force,
               export_custom_keywords,
+              export_file_external,
+              export_file_externals2
              ]
 
 if __name__ == '__main__':



Mime
View raw message