You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2018/05/10 15:26:07 UTC

svn commit: r1831349 - /subversion/trunk/subversion/libsvn_client/shelf.c

Author: julianfoad
Date: Thu May 10 15:26:07 2018
New Revision: 1831349

URL: http://svn.apache.org/viewvc?rev=1831349&view=rev
Log:
Shelving: Remember to delete the whole-files storage area when rolling back
or deleting a shelf.

* subversion/libsvn_client/shelf.c
  (shelf_version_delete): Renamed from shelf_delete_patch_file. Delete the
    whole-files storage as well as the patch file.
  (...elsewhere...): Track the rename.

Modified:
    subversion/trunk/subversion/libsvn_client/shelf.c

Modified: subversion/trunk/subversion/libsvn_client/shelf.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/shelf.c?rev=1831349&r1=1831348&r2=1831349&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/shelf.c (original)
+++ subversion/trunk/subversion/libsvn_client/shelf.c Thu May 10 15:26:07 2018
@@ -176,17 +176,25 @@ get_existing_patch_abspath(const char **
   return SVN_NO_ERROR;
 }
 
+/* Delete the storage for SHELF:VERSION. */
 static svn_error_t *
-shelf_delete_patch_file(svn_client_shelf_t *shelf,
-                        int version,
-                        apr_pool_t *scratch_pool)
+shelf_version_delete(svn_client_shelf_t *shelf,
+                     int version,
+                     apr_pool_t *scratch_pool)
 {
   const char *patch_abspath;
+  const char *files_dir_abspath;
 
   SVN_ERR(get_existing_patch_abspath(&patch_abspath, shelf, version,
                                      scratch_pool, scratch_pool));
   SVN_ERR(svn_io_remove_file2(patch_abspath, TRUE /*ignore_enoent*/,
                               scratch_pool));
+  SVN_ERR(shelf_version_files_dir_abspath(&files_dir_abspath,
+                                          shelf, version,
+                                          scratch_pool, scratch_pool));
+  SVN_ERR(svn_io_remove_dir2(files_dir_abspath, TRUE /*ignore_enoent*/,
+                             NULL, NULL, /*cancel*/
+                             scratch_pool));
   return SVN_NO_ERROR;
 }
 
@@ -816,7 +824,7 @@ svn_client_shelf_delete(const char *name
   /* Remove the patches. */
   for (i = shelf->max_version; i > 0; i--)
     {
-      SVN_ERR(shelf_delete_patch_file(shelf, i, scratch_pool));
+      SVN_ERR(shelf_version_delete(shelf, i, scratch_pool));
     }
 
   /* Remove the other files */
@@ -1184,7 +1192,7 @@ svn_client_shelf_delete_newer_versions(s
   /* Delete any newer checkpoints */
   for (i = shelf->max_version; i > previous_version; i--)
     {
-      SVN_ERR(shelf_delete_patch_file(shelf, i, scratch_pool));
+      SVN_ERR(shelf_version_delete(shelf, i, scratch_pool));
     }
 
   shelf->max_version = previous_version;