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.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/pristines-on-demand-on-mwf@1905760 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/subversion/include/svn_wc.h b/subversion/include/svn_wc.h
index f3a0d08..900eb08 100644
--- a/subversion/include/svn_wc.h
+++ b/subversion/include/svn_wc.h
@@ -5579,10 +5579,13 @@
                         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.
diff --git a/subversion/libsvn_wc/deprecated.c b/subversion/libsvn_wc/deprecated.c
index 0eb3a40..795d9b0 100644
--- a/subversion/libsvn_wc/deprecated.c
+++ b/subversion/libsvn_wc/deprecated.c
@@ -170,12 +170,16 @@
                         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,