Author: dsahlberg
Date: Thu Dec 25 14:21:03 2025
New Revision: 1930851

Log:
Revert r1915215 and r1915466.

* subversion/include/svn_wc.h
  (svn_wc_notify_action_t): Remove notification type
* subversion/libsvn_wc/revert.c
  (revert_wc_data): Remove new parameter to indicate the need for notification
                    of "no access" and use that when a file is readonly but
                    (some other user) already has W.
  (revert_restore): Remove handling the "no access" case with the removed
                    notification type.
* subversion/svn/notify.c
  (notify_body): Remove handling the removed notification type
* subversion/svnbench/notify.c
  (notify): Remove handling the removed notification type

Removing these from the public API should be OK since they were not part
of a released version of Subversion.

Discussed on dev@: 
https://lists.apache.org/thread/v2ovxngg7sc5hvzn49oj568zfpmtz3qv

Modified:
   subversion/trunk/subversion/include/svn_wc.h
   subversion/trunk/subversion/libsvn_wc/revert.c
   subversion/trunk/subversion/svn/notify.c
   subversion/trunk/subversion/svnbench/notify.c

Modified: subversion/trunk/subversion/include/svn_wc.h
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h        Thu Dec 25 13:55:32 
2025        (r1930850)
+++ subversion/trunk/subversion/include/svn_wc.h        Thu Dec 25 14:21:03 
2025        (r1930851)
@@ -993,7 +993,6 @@ typedef enum svn_wc_notify_action_t
   svn_wc_notify_restore,
 
   /** Reverting a modified path. */
-  /* See also svn_wc_notify_revert_noaccess */
   svn_wc_notify_revert,
 
   /** A revert operation has failed. */
@@ -1326,12 +1325,6 @@ typedef enum svn_wc_notify_action_t
    * @since New in 1.15. */
   svn_wc_notify_warning,
 
-  /** A file is readonly for the user but isn't svn:needs-lock.
-   * So we want to restore RW, but fail since the file has W bits,
-   * just not for the current user.
-   * @since New in 1.15. */
-  svn_wc_notify_revert_noaccess,
-
 } svn_wc_notify_action_t;
 
 

Modified: subversion/trunk/subversion/libsvn_wc/revert.c
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/revert.c      Thu Dec 25 13:55:32 
2025        (r1930850)
+++ subversion/trunk/subversion/libsvn_wc/revert.c      Thu Dec 25 14:21:03 
2025        (r1930851)
@@ -263,7 +263,6 @@ revert_restore_handle_copied_dirs(svn_bo
 static svn_error_t *
 revert_wc_data(svn_boolean_t *run_wq,
                svn_boolean_t *notify_required,
-               svn_boolean_t *notify_noaccess,
                svn_wc__db_t *db,
                const char *local_abspath,
                svn_wc__db_status_t status,
@@ -310,7 +309,6 @@ revert_restore(svn_boolean_t *run_wq,
   svn_wc__db_status_t status;
   svn_node_kind_t kind;
   svn_boolean_t notify_required;
-  svn_boolean_t notify_noaccess;
   const apr_array_header_t *conflict_files;
   svn_filesize_t recorded_size;
   apr_time_t recorded_time;
@@ -400,7 +398,7 @@ revert_restore(svn_boolean_t *run_wq,
   if (!metadata_only)
     {
       SVN_ERR(revert_wc_data(run_wq,
-                             &notify_required, &notify_noaccess,
+                             &notify_required,
                              db, local_abspath, status, kind,
                              reverted_kind, recorded_size, recorded_time,
                              copied_here, use_commit_times,
@@ -421,19 +419,12 @@ revert_restore(svn_boolean_t *run_wq,
         }
     }
 
-  if (notify_func)
-    {
-      if (notify_required)
-        notify_func(notify_baton,
-                    svn_wc_create_notify(local_abspath, svn_wc_notify_revert,
-                                         scratch_pool),
-                    scratch_pool);
-      else if (notify_noaccess)
-        notify_func(notify_baton,
-                    svn_wc_create_notify(local_abspath, 
svn_wc_notify_revert_noaccess,
-                                         scratch_pool),
-                    scratch_pool);
-    }
+  if (notify_func && notify_required)
+    notify_func(notify_baton,
+                svn_wc_create_notify(local_abspath, svn_wc_notify_revert,
+                                     scratch_pool),
+                scratch_pool);
+
   if (depth == svn_depth_infinity && kind == svn_node_dir)
     {
       apr_pool_t *iterpool = svn_pool_create(scratch_pool);
@@ -491,7 +482,6 @@ revert_restore(svn_boolean_t *run_wq,
 static svn_error_t *
 revert_wc_data(svn_boolean_t *run_wq,
                svn_boolean_t *notify_required,
-               svn_boolean_t *notify_noaccess,
                svn_wc__db_t *db,
                const char *local_abspath,
                svn_wc__db_status_t status,
@@ -512,8 +502,6 @@ revert_wc_data(svn_boolean_t *run_wq,
   svn_boolean_t special;
 #endif
 
-  *notify_noaccess = FALSE; /* notify_required is reset elsewhere */
-
   /* Would be nice to use svn_io_dirent2_t here, but the performance
      improvement that provides doesn't work, because we need the read
      only and executable bits later on, in the most likely code path */
@@ -673,23 +661,11 @@ revert_wc_data(svn_boolean_t *run_wq,
                         }
                       else if (!needs_lock_prop && read_only)
                         {
-                          /* If there is already W on the file, it is owned by
-                          * some other user. Then svn_io_set_file_read_write
-                          * will return without making any changes and the
-                          * user will get a spurious "Reverted" message.
-                          * Only checking for user's W since that is the only
-                          * one set by svn_io_set_file_read_write()
-                          * Issue #4622 */
-                          if (finfo.protection & APR_UWRITE)
-                            *notify_noaccess = TRUE;
-                          else
-                            {
-                              SVN_ERR(svn_io_set_file_read_write(local_abspath,
-                                                                 FALSE,
-                                                                 
scratch_pool));
-                              *notify_required = TRUE;
-                            }
-                       }
+                          SVN_ERR(svn_io_set_file_read_write(local_abspath,
+                                                             FALSE,
+                                                             scratch_pool));
+                          *notify_required = TRUE;
+                        }
                     }
 
 #if !defined(WIN32) && !defined(__OS2__)

Modified: subversion/trunk/subversion/svn/notify.c
==============================================================================
--- subversion/trunk/subversion/svn/notify.c    Thu Dec 25 13:55:32 2025        
(r1930850)
+++ subversion/trunk/subversion/svn/notify.c    Thu Dec 25 14:21:03 2025        
(r1930851)
@@ -450,11 +450,6 @@ notify_body(struct notify_baton *nb,
                                  path_local));
       break;
 
-    case svn_wc_notify_revert_noaccess:
-      SVN_ERR(svn_cmdline_printf(pool, _("User doesn't have WRITE permissions 
to file '%s' and the file isn't svn:needslock. But the file is already 
writeable. Probably owned by another user."),
-                             path_local));
-      break;
-
     case svn_wc_notify_failed_revert:
       SVN_ERR(svn_cmdline_printf(pool, _("Failed to revert '%s' -- "
                                          "try updating instead.\n"),

Modified: subversion/trunk/subversion/svnbench/notify.c
==============================================================================
--- subversion/trunk/subversion/svnbench/notify.c       Thu Dec 25 13:55:32 
2025        (r1930850)
+++ subversion/trunk/subversion/svnbench/notify.c       Thu Dec 25 14:21:03 
2025        (r1930851)
@@ -241,12 +241,6 @@ notify(void *baton, const svn_wc_notify_
         goto print_error;
       break;
 
-    case svn_wc_notify_revert_noaccess:
-      if ((err = svn_cmdline_printf(pool, _("User doesn't have WRITE 
permissions to file '%s' and the file isn't svn:needslock. But the file is 
already writeable. Probably owned by another user."),
-                                    path_local)))
-        goto print_error;
-      break;
-
     case svn_wc_notify_failed_revert:
       if (( err = svn_cmdline_printf(pool, _("Failed to revert '%s' -- "
                                              "try updating instead.\n"),

Reply via email to