You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2014/04/17 09:46:09 UTC

svn commit: r1588145 - in /subversion/branches/1.8.x: ./ STATUS subversion/libsvn_client/commit_util.c subversion/libsvn_wc/status.c subversion/tests/cmdline/commit_tests.py

Author: svn-role
Date: Thu Apr 17 07:46:08 2014
New Revision: 1588145

URL: http://svn.apache.org/r1588145
Log:
Merge the r1571747 group from trunk:

 * r1571747, r1571787, r1571795
   Resolve the 'commit_util.c' (repos_root_url && repos_relpath) assertion.
   Notes:
     This assertion is raised when specifically committing a deleted
     descendant, like via a checkbox list in a GUI client.
   Justification:
     Often reported assertion by users. Upto now very hard to reproduce
     for these users. Probably because they didn't see that the node they
     deleted wasn't added to the repository yet.
   Votes:
     +1: rhuijben, philip, steveking

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/libsvn_client/commit_util.c
    subversion/branches/1.8.x/subversion/libsvn_wc/status.c
    subversion/branches/1.8.x/subversion/tests/cmdline/commit_tests.py

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1571747,1571787,1571795

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1588145&r1=1588144&r2=1588145&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Thu Apr 17 07:46:08 2014
@@ -321,18 +321,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1571747, r1571787, r1571795
-   Resolve the 'commit_util.c' (repos_root_url && repos_relpath) assertion.
-   Notes:
-     This assertion is raised when specifically committing a deleted
-     descendant, like via a checkbox list in a GUI client.
-   Justification:
-     Often reported assertion by users. Upto now very hard to reproduce
-     for these users. Probably because they didn't see that the node they
-     deleted wasn't added to the repository yet.
-   Votes:
-     +1: rhuijben, philip, steveking
-
  * r1577812, r1577813, r1579429
    Resolve a segfault when 'svn merge --force' merges a directory delete
    Justification:

Modified: subversion/branches/1.8.x/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_client/commit_util.c?rev=1588145&r1=1588144&r2=1588145&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_client/commit_util.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_client/commit_util.c Thu Apr 17 07:46:08 2014
@@ -892,7 +892,7 @@ harvest_status_callback(void *status_bat
   if (matches_changelists
       && (is_harvest_root || baton->changelists)
       && state_flags
-      && is_added
+      && (is_added || (is_deleted && is_op_root && status->copied))
       && baton->danglers)
     {
       /* If a node is added, its parent must exist in the repository at the

Modified: subversion/branches/1.8.x/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_wc/status.c?rev=1588145&r1=1588144&r2=1588145&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_wc/status.c Thu Apr 17 07:46:08 2014
@@ -421,13 +421,42 @@ get_repos_root_url_relpath(const char **
                                        db, local_abspath,
                                        result_pool, scratch_pool));
     }
-  else if (info->have_base)
+  else if (info->status == svn_wc__db_status_deleted
+           && !info->have_more_work
+           && info->have_base)
     {
       SVN_ERR(svn_wc__db_scan_base_repos(repos_relpath, repos_root_url,
                                          repos_uuid,
                                          db, local_abspath,
                                          result_pool, scratch_pool));
     }
+  else if (info->status == svn_wc__db_status_deleted)
+    {
+      const char *work_del_abspath;
+      const char *add_abspath;
+
+      /* Handles working DELETE and the special case where there is just
+         svn_wc__db_status_not_present in WORKING */
+
+      SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL, &work_del_abspath, NULL,
+                                       db, local_abspath,
+                                       scratch_pool, scratch_pool));
+
+      /* The parent of what has been deleted must be added */
+      add_abspath = svn_dirent_dirname(work_del_abspath, scratch_pool);
+
+      SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, repos_relpath,
+                                       repos_root_url, repos_uuid, NULL,
+                                       NULL, NULL, NULL,
+                                       db, add_abspath,
+                                       result_pool, scratch_pool));
+
+      *repos_relpath = svn_relpath_join(*repos_relpath,
+                                        svn_dirent_skip_ancestor(
+                                              add_abspath,
+                                              local_abspath),
+                                        result_pool);
+    }
   else
     {
       *repos_relpath = NULL;

Modified: subversion/branches/1.8.x/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/tests/cmdline/commit_tests.py?rev=1588145&r1=1588144&r2=1588145&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/branches/1.8.x/subversion/tests/cmdline/commit_tests.py Thu Apr 17 07:46:08 2014
@@ -3008,7 +3008,64 @@ def commit_cp_with_deep_delete(sbox):
                                         None,
                                         wc_dir)
 
-  
+def commit_deep_deleted(sbox):
+  "try to commit a deep descendant of a deleted node"
+
+  sbox.build()
+
+  sbox.simple_move('A', 'AA')
+
+  sbox.simple_propset('k', 'v', 'AA/D/G')
+
+  # Committing some added descendant returns a proper error
+  expected_err = ('svn: E200009: \'%s\' is not known to exist in the ' +
+                  'repository and is not part of the commit, yet its ' +
+                  'child \'%s\' is part of the commit') % (
+                    re.escape(os.path.abspath(sbox.ospath('AA'))),
+                    re.escape(os.path.abspath(sbox.ospath('AA/D/G'))))
+
+  svntest.actions.run_and_verify_commit(sbox.wc_dir,
+                                        None,
+                                        None,
+                                        expected_err,
+                                        sbox.ospath('AA/D/G'))
+
+  sbox.simple_propdel('k', 'AA/D/G')
+  sbox.simple_rm('AA/D/G')
+
+  # But a delete fails..
+  # This used to trigger an assertion in Subversion 1.8.0-1.8.8, because
+  # the status walker couldn't find the repository path for AA/D/G
+  svntest.actions.run_and_verify_commit(sbox.wc_dir,
+                                        None,
+                                        None,
+                                        expected_err,
+                                        sbox.ospath('AA/D/G'))
+
+  # And now commit like how a GUI client would do it, but forgetting the move
+  expected_err = ('svn: E200009: Cannot commit \'%s\' because it was moved ' +
+                  'from \'%s\' which is not part of the commit; both sides ' +
+                  'of the move must be committed together') % (
+                     re.escape(os.path.abspath(sbox.ospath('AA'))),
+                     re.escape(os.path.abspath(sbox.ospath('A'))))
+  svntest.actions.run_and_verify_commit(sbox.wc_dir,
+                                        None,
+                                        None,
+                                        expected_err,
+                                        '--depth', 'empty',
+                                        sbox.ospath('AA/D/G'),
+                                        sbox.ospath('AA'))
+
+
+  # And now how it works
+  svntest.actions.run_and_verify_commit(sbox.wc_dir,
+                                        None,
+                                        None,
+                                        [],
+                                        '--depth', 'empty',
+                                        sbox.ospath('AA/D/G'),
+                                        sbox.ospath('AA'),
+                                        sbox.ospath('A'))
 
 ########################################################################
 # Run the tests
@@ -3082,6 +3139,7 @@ test_list = [ None,
               commit_danglers,
               last_changed_of_copied_subdir,
               commit_cp_with_deep_delete,
+              commit_deep_deleted,
              ]
 
 if __name__ == '__main__':