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 2013/05/14 06:01:25 UTC

svn commit: r1482187 - in /subversion/branches/1.7.x: ./ STATUS subversion/libsvn_wc/adm_ops.c subversion/tests/cmdline/revert_tests.py

Author: svn-role
Date: Tue May 14 04:01:24 2013
New Revision: 1482187

URL: http://svn.apache.org/r1482187
Log:
Merge the r1423837 group from trunk:

 * r1423837, r1423840, r1423848
   Fix issue #4168, "no such table: revert_list" for nested wc in sparse wc
   Justification:
     Accessing the wrong database from the revert code gives an ugly error
     which might not be easy to work around.
   Votes:
     +1: rhuijben, pburba, stsp

Modified:
    subversion/branches/1.7.x/   (props changed)
    subversion/branches/1.7.x/STATUS
    subversion/branches/1.7.x/subversion/libsvn_wc/adm_ops.c
    subversion/branches/1.7.x/subversion/tests/cmdline/revert_tests.py

Propchange: subversion/branches/1.7.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1423837,1423840,1423848

Modified: subversion/branches/1.7.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1482187&r1=1482186&r2=1482187&view=diff
==============================================================================
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Tue May 14 04:01:24 2013
@@ -283,14 +283,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1423837, r1423840, r1423848
-   Fix issue #4168, "no such table: revert_list" for nested wc in sparse wc
-   Justification:
-     Accessing the wrong database from the revert code gives an ugly error
-     which might not be easy to work around.
-   Votes:
-     +1: rhuijben, pburba, stsp
-
  * r1426830
    Resolve issue #3797, by making sure that local changes at the same path
    as a not present file are not skipped.

Modified: subversion/branches/1.7.x/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_wc/adm_ops.c?rev=1482187&r1=1482186&r2=1482187&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/1.7.x/subversion/libsvn_wc/adm_ops.c Tue May 14 04:01:24 2013
@@ -1405,12 +1405,17 @@ revert_restore_handle_copied_dirs(svn_bo
 /* Make the working tree under LOCAL_ABSPATH to depth DEPTH match the
    versioned tree.  This function is called after svn_wc__db_op_revert
    has done the database revert and created the revert list.  Notifies
-   for all paths equal to or below LOCAL_ABSPATH that are reverted. */
+   for all paths equal to or below LOCAL_ABSPATH that are reverted.
+
+   REVERT_ROOT is true for explicit revert targets and FALSE for targets
+   reached via recursion.
+ */
 static svn_error_t *
 revert_restore(svn_wc__db_t *db,
                const char *local_abspath,
                svn_depth_t depth,
                svn_boolean_t use_commit_times,
+               svn_boolean_t revert_root,
                svn_cancel_func_t cancel_func,
                void *cancel_baton,
                svn_wc_notify_func2_t notify_func,
@@ -1434,10 +1439,31 @@ revert_restore(svn_wc__db_t *db,
 #endif
   svn_boolean_t copied_here;
   svn_wc__db_kind_t reverted_kind;
+  svn_boolean_t is_wcroot;
 
   if (cancel_func)
     SVN_ERR(cancel_func(cancel_baton));
 
+  SVN_ERR(svn_wc__db_is_wcroot(&is_wcroot, db, local_abspath, scratch_pool));
+  if (is_wcroot && !revert_root)
+    {
+      /* Issue #4162: Obstructing working copy. We can't access the working
+         copy data from the parent working copy for this node by just using
+         local_abspath */
+
+      if (notify_func)
+        {
+          svn_wc_notify_t *notify = svn_wc_create_notify(
+                                        local_abspath,
+                                        svn_wc_notify_update_skip_obstruction,
+                                        scratch_pool);
+
+          notify_func(notify_baton, notify, scratch_pool);
+        }
+
+      return SVN_NO_ERROR; /* We don't revert obstructing working copies */
+    }
+
   SVN_ERR(svn_wc__db_revert_list_read(&notify_required,
                                       &conflict_old, &conflict_new,
                                       &conflict_working, &prop_reject,
@@ -1743,7 +1769,7 @@ revert_restore(svn_wc__db_t *db,
                                           iterpool);
 
           SVN_ERR(revert_restore(db, child_abspath, depth,
-                                 use_commit_times,
+                                 use_commit_times, FALSE /* revert root */,
                                  cancel_func, cancel_baton,
                                  notify_func, notify_baton,
                                  iterpool));
@@ -1795,7 +1821,7 @@ new_revert_internal(svn_wc__db_t *db,
 
   if (!err)
     err = revert_restore(db, local_abspath, depth,
-                         use_commit_times,
+                         use_commit_times, TRUE /* revert root */,
                          cancel_func, cancel_baton,
                          notify_func, notify_baton,
                          scratch_pool);

Modified: subversion/branches/1.7.x/subversion/tests/cmdline/revert_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/tests/cmdline/revert_tests.py?rev=1482187&r1=1482186&r2=1482187&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/branches/1.7.x/subversion/tests/cmdline/revert_tests.py Tue May 14 04:01:24 2013
@@ -1585,6 +1585,52 @@ def revert_with_unversioned_targets(sbox
   actual_disk = svntest.tree.build_tree_from_wc(wc_dir, 1)
   svntest.tree.compare_trees("disk", actual_disk, expected_disk.old_tree())
 
+@Issue(4168)
+def revert_obstructing_wc(sbox):
+  "revert with an obstructing working copy"
+  
+  sbox.build(create_wc=False, read_only=True)
+  wc_dir = sbox.wc_dir
+  
+  expected_output = svntest.wc.State(wc_dir, {})
+  expected_disk = svntest.wc.State(wc_dir, {})  
+  
+  # Checkout wc as depth empty
+  svntest.actions.run_and_verify_checkout(sbox.repo_url, wc_dir,
+                                          expected_output, expected_disk,
+                                          None, None, None, None,
+                                          '--depth', 'empty')
+
+  # And create an obstructing working copy as A
+  svntest.actions.run_and_verify_checkout(sbox.repo_url, wc_dir + '/A',
+                                          expected_output, expected_disk,
+                                          None, None, None, None,
+                                          '--depth', 'empty')
+
+  # Now try to fetch the entire wc, which will find an obstruction
+  expected_output = svntest.wc.State(wc_dir, {
+    'A'     : Item(verb='Skipped'),
+    'iota'  : Item(status='A '),
+  })
+  expected_status = svntest.wc.State(wc_dir, {
+    ''      : Item(status='  ', wc_rev='1'),
+    'iota'  : Item(status='  ', wc_rev='1'),
+    # A is not versioned but exists
+  })
+
+  svntest.actions.run_and_verify_update(wc_dir,
+                                        expected_output, None, expected_status,
+                                        None, None, None,
+                                        None, None, None,
+                                        wc_dir, '--set-depth', 'infinity')
+
+  # Revert should do nothing (no local changes), and report the obstruction
+  # (reporting the obstruction is nice for debuging, but not really required
+  #  in this specific case, as the node was not modified)
+  svntest.actions.run_and_verify_svn(None, "Skipped '.*A' -- .*obstruct.*", [],
+                                     'revert', '-R', wc_dir)
+
+
 ########################################################################
 # Run the tests
 
@@ -1623,6 +1669,7 @@ test_list = [ None,
               revert_no_text_change_conflict,
               revert_no_text_change_conflict_recursive,
               revert_with_unversioned_targets,
+              revert_obstructing_wc
              ]
 
 if __name__ == '__main__':