You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2014/02/28 21:47:24 UTC

svn commit: r1573071 - in /subversion/trunk/subversion: include/svn_fs.h libsvn_fs_fs/fs_fs.c libsvn_fs_x/fs_x.c

Author: stefan2
Date: Fri Feb 28 20:47:24 2014
New Revision: 1573071

URL: http://svn.apache.org/r1573071
Log:
Fix a regression in svn_fs_props_changed: it should always report
path@root to be equal to path@root - even for txn roots.

Only FSFS and FSX backends are affected as their property reps are
indistinguishable within a transaction.

* subversion/include/svn_fs.h
  (svn_fs_props_changed): Explain that old releases had a problem
                          with prop lists in FSFS txns.

* subversion/libsvn_fs_fs/fs_fs.c
  (svn_fs_fs__file_text_rep_equal,
   svn_fs_fs__prop_rep_equal): Representation is of the same node
                               always match.

* subversion/libsvn_fs_x/fs_x.c
  (svn_fs_x__prop_rep_equal): Same.

Found by: breser

Modified:
    subversion/trunk/subversion/include/svn_fs.h
    subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
    subversion/trunk/subversion/libsvn_fs_x/fs_x.c

Modified: subversion/trunk/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_fs.h?rev=1573071&r1=1573070&r2=1573071&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_fs.h (original)
+++ subversion/trunk/subversion/include/svn_fs.h Fri Feb 28 20:47:24 2014
@@ -1680,9 +1680,8 @@ svn_fs_change_node_prop(svn_fs_root_t *r
  *
  * @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.  It is perfectly legal to report all combinations
- * as "changed" even for @a path1 == @a path2 and @a root1 == @a root2.
- * There is also no guarantee that there will be false positives at all.
+ * and backend to backend.  There is also no guarantee that there will be
+ * false positives at all.
  *
  * @since New in 1.9.
  */
@@ -1698,6 +1697,11 @@ svn_fs_props_changed2(svn_boolean_t *cha
 
 /** 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.
+ *
  * @deprecated Provided for backward compatibility with the 1.8 API.
  */
 SVN_DEPRECATED
@@ -2263,9 +2267,8 @@ svn_fs_apply_text(svn_stream_t **content
  *
  * @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.  It is perfectly legal to report all combinations
- * as "changed" even for @a path1 == @a path2 and @a root1 == @a root2.
- * There is also no guarantee that there will be false positives at all.
+ * and backend to backend.  There is also no guarantee that there will be
+ * false positives at all.
  *
  * @since New in 1.9.
  */

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1573071&r1=1573070&r2=1573071&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Fri Feb 28 20:47:24 2014
@@ -1093,6 +1093,13 @@ svn_fs_fs__file_text_rep_equal(svn_boole
       return SVN_NO_ERROR;
     }
 
+  /* Same path in same rev or txn? */
+  if (svn_fs_fs__id_eq(a->id, b->id))
+    {
+      *equal = TRUE;
+      return SVN_NO_ERROR;
+    }
+
   /* Old repositories may not have the SHA1 checksum handy.
      This check becomes expensive.  Skip it unless explicitly required. */
   if (!strict)
@@ -1143,8 +1150,15 @@ svn_fs_fs__prop_rep_equal(svn_boolean_t 
       return SVN_NO_ERROR;
     }
 
+  /* Same path in same txn? */
+  if (svn_fs_fs__id_eq(a->id, b->id))
+    {
+      *equal = TRUE;
+      return SVN_NO_ERROR;
+    }
+
   /* Skip the expensive bits unless we are in strict mode.
-     Simply assume that there is a different. */
+     Simply assume that there is a difference. */
   if (!strict)
     {
       *equal = FALSE;

Modified: subversion/trunk/subversion/libsvn_fs_x/fs_x.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/fs_x.c?rev=1573071&r1=1573070&r2=1573071&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/fs_x.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/fs_x.c Fri Feb 28 20:47:24 2014
@@ -694,6 +694,13 @@ svn_fs_x__prop_rep_equal(svn_boolean_t *
       return SVN_NO_ERROR;
     }
 
+  /* Same path in same txn? */
+  if (svn_fs_x__id_eq(a->id, b->id))
+    {
+      *equal = TRUE;
+      return SVN_NO_ERROR;
+    }
+
   /* Skip the expensive bits unless we are in strict mode.
      Simply assume that there is a different. */
   if (!strict)