You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ko...@apache.org on 2022/12/05 13:51:53 UTC

svn commit: r1905760 - in /subversion/branches/pristines-on-demand-on-mwf/subversion: include/svn_wc.h libsvn_wc/deprecated.c

Author: kotkov
Date: Mon Dec  5 13:51:52 2022
New Revision: 1905760

URL: http://svn.apache.org/viewvc?rev=1905760&view=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: In svn_wc_crawl_revisions5(),
do not return SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE unless this
deprecated function is called with restore_files set to true.

Other usages of this function, except when restoring files, don't require
access to the pristine contents, so let's not limit them more than necessary.

* subversion/include/svn_wc.h
  (svn_wc_crawl_revisions5): Tweak documentation.

* subversion/libsvn_wc/deprecated.c
  (svn_wc_crawl_revisions5): Check the working copy settings and return an
   error only when restore_files is true.

Modified:
    subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h?rev=1905760&r1=1905759&r2=1905760&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h Mon Dec  5 13:51:52 2022
@@ -5579,10 +5579,13 @@ svn_wc_crawl_revisions6(svn_wc_context_t
                         apr_pool_t *scratch_pool);
 
 /**
- * Similar to svn_wc_crawl_revisions6, but this function can only be used
- * for working copies that store local copies of all pristine contents.
- * Otherwise, an #SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE error will be
- * returned.
+ * Similar to svn_wc_crawl_revisions6, but if @a restore_files is @c TRUE,
+ * this function can only be used for working copies that store local
+ * copies of all pristine contents.
+ *
+ * If @a restore_files is @c TRUE and a working copy doesn't store local copies
+ * of all pristine contents, an #SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE
+ * error will be returned.
  *
  * @since New in 1.7.
  * @deprecated Provided for compatibility with the 1.7 API.

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c?rev=1905760&r1=1905759&r2=1905760&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c Mon Dec  5 13:51:52 2022
@@ -170,12 +170,16 @@ svn_wc_crawl_revisions5(svn_wc_context_t
                         void *notify_baton,
                         apr_pool_t *scratch_pool)
 {
-  svn_boolean_t store_pristine;
+  if (restore_files)
+    {
+      svn_boolean_t store_pristine;
 
-  SVN_ERR(svn_wc__get_settings(NULL, &store_pristine, wc_ctx, local_abspath,
-                               scratch_pool));
-  if (!store_pristine)
-    return svn_error_create(SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE, NULL, NULL);
+      SVN_ERR(svn_wc__get_settings(NULL, &store_pristine, wc_ctx, local_abspath,
+                                   scratch_pool));
+      if (!store_pristine)
+        return svn_error_create(SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE,
+                                NULL, NULL);
+    }
 
   SVN_ERR(svn_wc_crawl_revisions6(wc_ctx,
                                   local_abspath,