Author: hwright
Date: Mon May 16 16:15:05 2011
New Revision: 1103783

URL: http://svn.apache.org/viewvc?rev=1103783&view=rev
Log:
Reintegrate the 1.6.x-issue3853 branch:

 * r1091881
   Fix issue #3853, "svn cleanup fails with obstructed directories"
   Justification:
     Trunk doesn't fail like this. Without this fix, cleaning up working
     copies containing obstructing directories is a huge hassle.
   Branch: ^/subversion/branches/1.6.x-issue3853
   Votes:
     +1: stsp, pburba, jcorvel

Modified:
    subversion/branches/1.6.x/   (props changed)
    subversion/branches/1.6.x/STATUS
    subversion/branches/1.6.x/subversion/libsvn_wc/log.c

Propchange: subversion/branches/1.6.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 16 16:15:05 2011
@@ -26,6 +26,7 @@
 /subversion/branches/1.6.x-issue3719:1075930-1096984
 /subversion/branches/1.6.x-issue3727:1032967-1033213
 /subversion/branches/1.6.x-issue3745:1032257-1033223
+/subversion/branches/1.6.x-issue3853:1091877-1103782
 /subversion/branches/1.6.x-no-svn_uri:876360-876415
 /subversion/branches/1.6.x-no-wcng-check:1022248-1035322
 /subversion/branches/1.6.x-r1002094:1002741-1002773

Modified: subversion/branches/1.6.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.6.x/STATUS?rev=1103783&r1=1103782&r2=1103783&view=diff
==============================================================================
--- subversion/branches/1.6.x/STATUS (original)
+++ subversion/branches/1.6.x/STATUS Mon May 16 16:15:05 2011
@@ -412,12 +412,3 @@ Approved changes:
                  that are currently nominated...so my +1 is conditional on
                  that fix being applied first.)
      +1: danielsh (pburba: a fix to #3641 was committed to trunk)
-
- * r1091881
-   Fix issue #3853, "svn cleanup fails with obstructed directories"
-   Justification:
-     Trunk doesn't fail like this. Without this fix, cleaning up working
-     copies containing obstructing directories is a huge hassle.
-   Branch: ^/subversion/branches/1.6.x-issue3853
-   Votes:
-     +1: stsp, pburba, jcorvel

Modified: subversion/branches/1.6.x/subversion/libsvn_wc/log.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/libsvn_wc/log.c?rev=1103783&r1=1103782&r2=1103783&view=diff
==============================================================================
--- subversion/branches/1.6.x/subversion/libsvn_wc/log.c (original)
+++ subversion/branches/1.6.x/subversion/libsvn_wc/log.c Mon May 16 16:15:05 
2011
@@ -2501,12 +2501,14 @@ svn_wc_cleanup(const char *path,
   return svn_wc_cleanup2(path, diff3_cmd, cancel_func, cancel_baton, pool);
 }
 
-svn_error_t *
-svn_wc_cleanup2(const char *path,
-                const char *diff3_cmd,
-                svn_cancel_func_t cancel_func,
-                void *cancel_baton,
-                apr_pool_t *pool)
+
+static svn_error_t *
+cleanup_internal(const char *path,
+                 const char *diff3_cmd,
+                 svn_cancel_func_t cancel_func,
+                 void *cancel_baton,
+                 svn_boolean_t already_recursing,
+                 apr_pool_t *pool)
 {
   apr_hash_t *entries = NULL;
   apr_hash_index_t *hi;
@@ -2525,10 +2527,18 @@ svn_wc_cleanup2(const char *path,
 
   /* a "version" of 0 means a non-wc directory */
   if (wc_format_version == 0)
-    return svn_error_createf
-      (SVN_ERR_WC_NOT_DIRECTORY, NULL,
-       _("'%s' is not a working copy directory"),
-       svn_path_local_style(path, pool));
+    {
+      /* If we've been asked to cleanup a non-working copy, bail out.
+       * But if this directory is simply found missing during recursion,
+       * silently ignore it. */
+      if (already_recursing)
+        return SVN_NO_ERROR;
+      else
+        return svn_error_createf
+          (SVN_ERR_WC_NOT_DIRECTORY, NULL,
+           _("'%s' is not a working copy directory"),
+           svn_path_local_style(path, pool));
+    }
 
   /* Lock this working copy directory, or steal an existing lock */
   SVN_ERR(svn_wc__adm_steal_write_lock(&adm_access, NULL, path, pool));
@@ -2554,8 +2564,9 @@ svn_wc_cleanup2(const char *path,
           /* Sub-directories */
           SVN_ERR(svn_io_check_path(entry_path, &kind, subpool));
           if (kind == svn_node_dir)
-            SVN_ERR(svn_wc_cleanup2(entry_path, diff3_cmd,
-                                    cancel_func, cancel_baton, subpool));
+            SVN_ERR(cleanup_internal(entry_path, diff3_cmd,
+                                     cancel_func, cancel_baton,
+                                     TRUE, subpool));
         }
       else
         {
@@ -2598,3 +2609,15 @@ svn_wc_cleanup2(const char *path,
 
   return svn_wc_adm_close2(adm_access, pool);
 }
+
+svn_error_t *
+svn_wc_cleanup2(const char *path,
+                const char *diff3_cmd,
+                svn_cancel_func_t cancel_func,
+                void *cancel_baton,
+                apr_pool_t *pool)
+{
+  return cleanup_internal(path, diff3_cmd, cancel_func, cancel_baton,
+                          FALSE, pool);
+
+}


Reply via email to