subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svn-r...@apache.org
Subject svn commit: r1561443 - in /subversion/branches/1.8.x: ./ STATUS subversion/libsvn_wc/wc_db.c subversion/tests/cmdline/copy_tests.py
Date Sun, 26 Jan 2014 04:04:33 GMT
Author: svn-role
Date: Sun Jan 26 04:04:32 2014
New Revision: 1561443

URL: http://svn.apache.org/r1561443
Log:
Merge the r1560690 group from trunk:

 * r1560690, r1560701
   Fix repository-WC copies into relocated working copies and some wc-wc
   copy problems.
   Justifiation:
     It should be impossible to break a working copy by just copying something
     into it.
   Notes:
     r1560690 is the fix and r1560701 a regression test for this problem.
   Votes:
     +1: rhuijben, brane, stefan2

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/libsvn_wc/wc_db.c
    subversion/branches/1.8.x/subversion/tests/cmdline/copy_tests.py

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1560690,1560701

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1561443&r1=1561442&r2=1561443&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Sun Jan 26 04:04:32 2014
@@ -264,17 +264,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1560690, r1560701
-   Fix repository-WC copies into relocated working copies and some wc-wc
-   copy problems.
-   Justifiation:
-     It should be impossible to break a working copy by just copying something
-     into it.
-   Notes:
-     r1560690 is the fix and r1560701 a regression test for this problem.
-   Votes:
-     +1: rhuijben, brane, stefan2
-
  * r1547866, r1547873, r1548097, r1548170
    Fix issue 3437, rep-cache.db created without group write bit
    Justification:

Modified: subversion/branches/1.8.x/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_wc/wc_db.c?rev=1561443&r1=1561442&r2=1561443&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_wc/wc_db.c Sun Jan 26 04:04:32 2014
@@ -4562,6 +4562,21 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
     }
   else
     {
+      if (copyfrom_relpath)
+        {
+          const char *repos_root_url;
+          const char *repos_uuid;
+
+          /* Pass the right repos-id for the destination db! */
+
+          SVN_ERR(svn_wc__db_fetch_repos_info(&repos_root_url, &repos_uuid,
+                                              src_wcroot->sdb, copyfrom_id,
+                                              scratch_pool));
+
+          SVN_ERR(create_repos_id(&copyfrom_id, repos_root_url, repos_uuid,
+                                  dst_wcroot->sdb, scratch_pool));
+        }
+
       SVN_ERR(cross_db_copy(src_wcroot, src_relpath, dst_wcroot,
                             dst_relpath, dst_presence, dst_op_depth,
                             dst_np_op_depth, kind,

Modified: subversion/branches/1.8.x/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/tests/cmdline/copy_tests.py?rev=1561443&r1=1561442&r2=1561443&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/1.8.x/subversion/tests/cmdline/copy_tests.py Sun Jan 26 04:04:32 2014
@@ -25,7 +25,7 @@
 ######################################################################
 
 # General modules
-import stat, os, re, shutil, logging
+import stat, os, re, shutil, logging, sys
 
 logger = logging.getLogger()
 
@@ -5787,6 +5787,33 @@ def copy_over_excluded(sbox):
                                        sbox.ospath('A/C'),
                                        sbox.ospath('A/D'))
 
+def copy_relocate(sbox):
+  "copy from a relocated location"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  tmp_dir = sbox.add_wc_path('relocated')
+
+  shutil.copytree(sbox.repo_dir, tmp_dir)
+
+  url = 'file://'
+
+  if sys.platform == 'win32':
+    url += '/'
+
+  url += os.path.abspath(tmp_dir).replace(os.path.sep, '/')
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'relocate', url, wc_dir)
+
+  copiedpath = sbox.ospath('AA')
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'cp', url + '/A', copiedpath)
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'info', copiedpath)
+
 ########################################################################
 # Run the tests
 
@@ -5904,6 +5931,7 @@ test_list = [ None,
               copy_to_unversioned_parent,
               copy_text_conflict,
               copy_over_excluded,
+              copy_relocate,
              ]
 
 if __name__ == '__main__':



Mime
View raw message