subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1573111 - in /subversion/trunk/subversion: include/svn_fs.h include/svn_ra.h include/svn_repos.h libsvn_fs/fs-loader.c libsvn_repos/delta.c libsvn_repos/dump.c libsvn_repos/reporter.c libsvn_repos/rev_hunt.c
Date Fri, 28 Feb 2014 23:20:41 GMT
Author: stefan2
Date: Fri Feb 28 23:20:41 2014
New Revision: 1573111

URL: http://svn.apache.org/r1573111
Log:
Follow-up to r1572363: Instead of using a "STRICT" parameter, split the
contents comparison functions into the old approximate ones and a new
exact ones.

There seems to be no point in having the boolean option as other code
would always set it to TRUE.  Even svn_*_get_file_revs2 will now always
operate in "strict" mode because there is little point in not doing so.
(Adding a "strict" flag svn_*_get_file_revs2 would cause major code churn
just to have the only client-side user, blame(), set it fixed to TRUE).

* subversion/include/svn_fs.h
  (svn_fs_props_changed2): Rename to ...
  (svn_fs_props_different): ... this and drop the STRICT parameter. 
  (svn_fs_props_changed): De-deprecate.
  (svn_fs_contents_changed2): Rename to ...
  (svn_fs_contents_different): ... this and drop the STRICT parameter.
  (svn_fs_contents_changed): De-deprecate.

* subversion/include/svn_ra.h
  (svn_ra_get_file_revs2): Document that we won't send random empty
                           deltas anymore.

* subversion/include/svn_repos.h
  (svn_ra_get_file_revs2): Ditto.

* subversion/libsvn_fs/fs-loader.c
  (svn_fs_props_changed2,
   svn_fs_props_different,
   svn_fs_contents_changed2,
   svn_fs_contents_different): Reflect to API change.

* subversion/libsvn_repos/delta.c
  (delta_proplists,
   svn_repos__compare_files,
   delta_files): Use the newly renamed strict API functions.

* subversion/libsvn_repos/dump.c
  (dump_node): Same.

* subversion/libsvn_repos/reporter.c
  (delta_proplists): Same.

* subversion/libsvn_repos/rev_hunt.c
  (send_path_revision): Same. This enables the new, predictable / strict
                        behavior of svn_*_get_file_revs2.

Modified:
    subversion/trunk/subversion/include/svn_fs.h
    subversion/trunk/subversion/include/svn_ra.h
    subversion/trunk/subversion/include/svn_repos.h
    subversion/trunk/subversion/libsvn_fs/fs-loader.c
    subversion/trunk/subversion/libsvn_repos/delta.c
    subversion/trunk/subversion/libsvn_repos/dump.c
    subversion/trunk/subversion/libsvn_repos/reporter.c
    subversion/trunk/subversion/libsvn_repos/rev_hunt.c

Modified: subversion/trunk/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_fs.h?rev=1573111&r1=1573110&r2=1573111&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_fs.h (original)
+++ subversion/trunk/subversion/include/svn_fs.h Fri Feb 28 23:20:41 2014
@@ -1670,41 +1670,43 @@ svn_fs_change_node_prop(svn_fs_root_t *r
 
 /** Determine if the properties of two path/root combinations are different.
  *
- * Set @a *changed_p to #TRUE if the properties at @a path1 under @a root1
+ * Set @a *different_p to #TRUE if the properties at @a path1 under @a root1
  * differ from those at @a path2 under @a root2, or set it to #FALSE if they
- * are the same.  If @a strict is #FALSE, the function may report false
- * positives, otherwise a full comparison may be necessary.  Both paths must
- * exist under their respective roots, and both roots must be in the same
- * filesystem.
+ * are the same.  Both paths must exist under their respective roots, and
+ * both roots must be in the same filesystem.
  * Do any necessary temporary allocation in @a pool.
  *
- * @note The behavior under @a strict == #FALSE is implementation dependent
- * in that the false positives reported may differ from release to release
- * and backend to backend.  There is also no guarantee that there will be
- * false positives at all.
- *
  * @since New in 1.9.
  */
 svn_error_t *
-svn_fs_props_changed2(svn_boolean_t *changed_p,
-                      svn_fs_root_t *root1,
-                      const char *path1,
-                      svn_fs_root_t *root2,
-                      const char *path2,
-                      svn_boolean_t strict,
-                      apr_pool_t *pool);
-
-
-/** Similar to svn_fs_props_changed2 with @a strict set to #FALSE.
- *
- * @note Prior to Subversion 1.9, this function could return false negatives
- * as well: If @a root1 and @a root2 were both transaction roots and the
- * proplists of both paths had been changed in their respective transactions,
- * @a changed_p would be set to #FALSE in FSFS.
+svn_fs_props_different(svn_boolean_t *different_p,
+                       svn_fs_root_t *root1,
+                       const char *path1,
+                       svn_fs_root_t *root2,
+                       const char *path2,
+                       apr_pool_t *pool);
+
+
+/** Determine if the properties of two path/root combinations are different.
+ * In contrast to #svn_fs_props_different, we only perform a quick test and
+ * allow for false positives.
+ *
+ * Set @a *changed_p to #TRUE if the properties at @a path1 under @a root1
+ * differ from those at @a path2 under @a root2, or set it to #FALSE if they
+ * are the same.  Both paths must exist under their respective roots, and
+ * both roots must be in the same filesystem.
+ * Do any necessary temporary allocation in @a pool.
  *
- * @deprecated Provided for backward compatibility with the 1.8 API.
+ * @note The behavior is implementation dependent in that the false
+ * positives reported may differ from release to release and backend to
+ * backend.  There is also no guarantee that there will be false positives
+ * at all.
+ *
+ * @note Prior to Subversion 1.9, this function would return false negatives
+ * as well for FSFS: If @a root1 and @a root2 were both transaction roots
+ * and the proplists of both paths had been changed in their respective
+ * transactions, @a changed_p would be set to #FALSE.
  */
-SVN_DEPRECATED
 svn_error_t *
 svn_fs_props_changed(svn_boolean_t *changed_p,
                      svn_fs_root_t *root1,
@@ -2257,35 +2259,37 @@ svn_fs_apply_text(svn_stream_t **content
 
 /** Check if the contents of two root/path combos have changed.
  *
- * Set @a *changed_p to #TRUE if the file contents at @a path1 under
+ * Set @a *different_p to #TRUE if the file contents at @a path1 under
  * @a root1 differ from those at @a path2 under @a root2, or set it to
- * #FALSE if they are the same.  If @a strict is #FALSE, the function may
- * report false positives, otherwise a full comparison may be necessary.
- * Both paths must exist under their respective roots, and both roots must
- * be in the same filesystem.
+ * #FALSE if they are the same.  Both paths must exist under their
+ * respective roots, and both roots must be in the same filesystem.
  * Do any necessary temporary allocation in @a pool.
  *
- * @note The behavior under @a strict == #FALSE is implementation dependent
- * in that the false positives reported may differ from release to release
- * and backend to backend.  There is also no guarantee that there will be
- * false positives at all.
- *
  * @since New in 1.9.
  */
 svn_error_t *
-svn_fs_contents_changed2(svn_boolean_t *changed_p,
-                         svn_fs_root_t *root1,
-                         const char *path1,
-                         svn_fs_root_t *root2,
-                         const char *path2,
-                         svn_boolean_t strict,
-                         apr_pool_t *pool);
-
-/** Similar to svn_fs_contents_changed2 with @a strict set to #FALSE.
+svn_fs_contents_different(svn_boolean_t *different_p,
+                          svn_fs_root_t *root1,
+                          const char *path1,
+                          svn_fs_root_t *root2,
+                          const char *path2,
+                          apr_pool_t *pool);
+
+/** Check if the contents of two root/path combos have changed.  In
+ * contrast to #svn_fs_contents_different, we only perform a quick test
+ * and allow for false positives.
  *
- * @deprecated Provided for backward compatibility with the 1.8 API.
+ * Set @a *changed_p to #TRUE if the file contents at @a path1 under
+ * @a root1 differ from those at @a path2 under @a root2, or set it to
+ * #FALSE if they are the same.  Both paths must exist under their
+ * respective roots, and both roots must be in the same filesystem.
+ * Do any necessary temporary allocation in @a pool.
+ *
+ * @note The behavior is implementation dependent in that the false
+ * positives reported may differ from release to release and backend to
+ * backend.  There is also no guarantee that there will be false positives
+ * at all.
  */
-SVN_DEPRECATED
 svn_error_t *
 svn_fs_contents_changed(svn_boolean_t *changed_p,
                         svn_fs_root_t *root1,

Modified: subversion/trunk/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_ra.h?rev=1573111&r1=1573110&r2=1573111&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_ra.h (original)
+++ subversion/trunk/subversion/include/svn_ra.h Fri Feb 28 23:20:41 2014
@@ -1846,6 +1846,12 @@ svn_ra_get_location_segments(svn_ra_sess
  * to support reversion of the revision range for @a include_merged_revision
  * @c FALSE reporting by switching  @a end with @a start.
  *
+ * @note Prior to Subversion 1.9, this function may accept delta handlers
+ * from @handler even for empty text deltas.  Starting with 1.9, the
+ * delta handler / baton return arguments passed to @handler will be
+ * #NULL unless there is an actual difference in the file contents between
+ * the current and the previous call.
+ *
  * @since New in 1.5.
  */
 svn_error_t *

Modified: subversion/trunk/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_repos.h?rev=1573111&r1=1573110&r2=1573111&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_repos.h (original)
+++ subversion/trunk/subversion/include/svn_repos.h Fri Feb 28 23:20:41 2014
@@ -2036,6 +2036,12 @@ svn_repos_fs_get_mergeinfo(svn_mergeinfo
  * the revision range for @a include_merged_revision @c FALSE reporting by
  * switching @a start with @a end.
  *
+ * @note Prior to Subversion 1.9, this function may accept delta handlers
+ * from @handler even for empty text deltas.  Starting with 1.9, the
+ * delta handler / baton return arguments passed to @handler will be
+ * #NULL unless there is an actual difference in the file contents between
+ * the current and the previous call.
+ *
  * @since New in 1.5.
  */
 svn_error_t *

Modified: subversion/trunk/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/fs-loader.c?rev=1573111&r1=1573110&r2=1573111&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/trunk/subversion/libsvn_fs/fs-loader.c Fri Feb 28 23:20:41 2014
@@ -1167,15 +1167,14 @@ svn_fs_change_node_prop(svn_fs_root_t *r
 }
 
 svn_error_t *
-svn_fs_props_changed2(svn_boolean_t *changed_p, svn_fs_root_t *root1,
-                      const char *path1, svn_fs_root_t *root2,
-                      const char *path2, svn_boolean_t strict,
-                      apr_pool_t *pool)
+svn_fs_props_different(svn_boolean_t *changed_p, svn_fs_root_t *root1,
+                       const char *path1, svn_fs_root_t *root2,
+                       const char *path2, apr_pool_t *pool)
 {
   return svn_error_trace(root1->vtable->props_changed(changed_p,
                                                       root1, path1,
                                                       root2, path2,
-                                                      strict, pool));
+                                                      TRUE, pool));
 }
 
 svn_error_t *
@@ -1454,15 +1453,14 @@ svn_fs_apply_text(svn_stream_t **content
 }
 
 svn_error_t *
-svn_fs_contents_changed2(svn_boolean_t *changed_p, svn_fs_root_t *root1,
-                         const char *path1, svn_fs_root_t *root2,
-                         const char *path2, svn_boolean_t strict,
-                         apr_pool_t *pool)
+svn_fs_contents_different(svn_boolean_t *changed_p, svn_fs_root_t *root1,
+                          const char *path1, svn_fs_root_t *root2,
+                          const char *path2, apr_pool_t *pool)
 {
   return svn_error_trace(root1->vtable->contents_changed(changed_p,
                                                          root1, path1,
                                                          root2, path2,
-                                                         strict, pool));
+                                                         TRUE, pool));
 }
 
 svn_error_t *

Modified: subversion/trunk/subversion/libsvn_repos/delta.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/delta.c?rev=1573111&r1=1573110&r2=1573111&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/delta.c (original)
+++ subversion/trunk/subversion/libsvn_repos/delta.c Fri Feb 28 23:20:41 2014
@@ -523,9 +523,8 @@ delta_proplists(struct context *c,
       svn_boolean_t changed;
 
       /* Is this deltification worth our time? */
-      SVN_ERR(svn_fs_props_changed2(&changed, c->target_root, target_path,
-                                    c->source_root, source_path, TRUE,
-                                    subpool));
+      SVN_ERR(svn_fs_props_different(&changed, c->target_root, target_path,
+                                     c->source_root, source_path, subpool));
       if (! changed)
         goto cleanup;
 
@@ -605,8 +604,8 @@ svn_repos__compare_files(svn_boolean_t *
                          const char *path2,
                          apr_pool_t *pool)
 {
-  return svn_error_trace(svn_fs_contents_changed2(changed_p, root1, path1,
-                                                  root2, path2, TRUE, pool));
+  return svn_error_trace(svn_fs_contents_different(changed_p, root1, path1,
+                                                   root2, path2, pool));
 }
 
 
@@ -633,10 +632,10 @@ delta_files(struct context *c,
 
   if (source_path)
     {
-      SVN_ERR(svn_fs_contents_changed2(&changed,
-                                       c->target_root, target_path,
-                                       c->source_root, source_path,
-                                       TRUE, subpool));
+      SVN_ERR(svn_fs_contents_different(&changed,
+                                        c->target_root, target_path,
+                                        c->source_root, source_path,
+                                        subpool));
     }
   else
     {

Modified: subversion/trunk/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/dump.c?rev=1573111&r1=1573110&r2=1573111&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/dump.c (original)
+++ subversion/trunk/subversion/libsvn_repos/dump.c Fri Feb 28 23:20:41 2014
@@ -857,13 +857,13 @@ dump_node(struct edit_baton *eb,
                                    svn_fs_root_fs(eb->fs_root),
                                    compare_rev, pool));
 
-      SVN_ERR(svn_fs_props_changed2(&must_dump_props,
-                                    compare_root, compare_path,
-                                    eb->fs_root, path, TRUE, pool));
+      SVN_ERR(svn_fs_props_different(&must_dump_props,
+                                     compare_root, compare_path,
+                                     eb->fs_root, path, pool));
       if (kind == svn_node_file)
-        SVN_ERR(svn_fs_contents_changed2(&must_dump_text,
-                                         compare_root, compare_path,
-                                         eb->fs_root, path, TRUE, pool));
+        SVN_ERR(svn_fs_contents_different(&must_dump_text,
+                                          compare_root, compare_path,
+                                          eb->fs_root, path, pool));
     }
   else if (action == svn_node_action_replace)
     {
@@ -1009,17 +1009,16 @@ dump_node(struct edit_baton *eb,
 
           /* Need to decide if the copied node had any extra textual or
              property mods as well.  */
-          SVN_ERR(svn_fs_props_changed2(&must_dump_props,
-                                        compare_root, compare_path,
-                                        eb->fs_root, path, TRUE, pool));
+          SVN_ERR(svn_fs_props_different(&must_dump_props,
+                                         compare_root, compare_path,
+                                         eb->fs_root, path, pool));
           if (kind == svn_node_file)
             {
               svn_checksum_t *checksum;
               const char *hex_digest;
-              SVN_ERR(svn_fs_contents_changed2(&must_dump_text,
-                                               compare_root, compare_path,
-                                               eb->fs_root, path, TRUE,
-                                               pool));
+              SVN_ERR(svn_fs_contents_different(&must_dump_text,
+                                                compare_root, compare_path,
+                                                eb->fs_root, path, pool));
 
               SVN_ERR(svn_fs_file_checksum(&checksum, svn_checksum_md5,
                                            compare_root, compare_path,

Modified: subversion/trunk/subversion/libsvn_repos/reporter.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/reporter.c?rev=1573111&r1=1573110&r2=1573111&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/reporter.c (original)
+++ subversion/trunk/subversion/libsvn_repos/reporter.c Fri Feb 28 23:20:41 2014
@@ -576,8 +576,8 @@ delta_proplists(report_baton_t *b, svn_r
       SVN_ERR(get_source_root(b, &s_root, s_rev));
 
       /* Is this deltification worth our time? */
-      SVN_ERR(svn_fs_props_changed2(&changed, b->t_root, t_path, s_root,
-                                    s_path, TRUE, pool));
+      SVN_ERR(svn_fs_props_different(&changed, b->t_root, t_path, s_root,
+                                     s_path, pool));
       if (! changed)
         return SVN_NO_ERROR;
 

Modified: subversion/trunk/subversion/libsvn_repos/rev_hunt.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/rev_hunt.c?rev=1573111&r1=1573110&r2=1573111&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/trunk/subversion/libsvn_repos/rev_hunt.c Fri Feb 28 23:20:41 2014
@@ -1366,9 +1366,9 @@ send_path_revision(struct path_revision 
      for now, as the blame implementation currently depends on them.) */
   /* Special case: In the first revision, we always provide a delta. */
   if (sb->last_root)
-    SVN_ERR(svn_fs_contents_changed2(&contents_changed, sb->last_root,
-                                     sb->last_path, root, path_rev->path,
-                                     FALSE, sb->iterpool));
+    SVN_ERR(svn_fs_contents_different(&contents_changed, sb->last_root,
+                                      sb->last_path, root, path_rev->path,
+                                      sb->iterpool));
   else
     contents_changed = TRUE;
 



Mime
View raw message