subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1669746 - in /subversion/trunk/subversion: include/ libsvn_fs/ libsvn_fs_base/ libsvn_fs_fs/ libsvn_fs_x/ libsvn_repos/ mod_dav_svn/ tests/libsvn_fs/
Date Sat, 28 Mar 2015 11:40:47 GMT
Author: stefan2
Date: Sat Mar 28 11:40:46 2015
New Revision: 1669746

URL: http://svn.apache.org/r1669746
Log:
FS API change: Rename svn_fs_node_same to svn_fs_node_unchanged.

Note that we currently (ab-)use the same enum in the FS implementation for
ID relationships but this is a mere convenience.  They don't have the same
semantics wrt. to edge cases and don't expose their use of the enum through
the FS API.

* subversion/include/svn_fs.h
  (svn_fs_node_relation_t): Rename said element and document the semantics
                            of all elements in terms of (root, path) pairs
                            other FS API concepts.  Be as strict as feasible.
                            Remove references to #svn_fs_compare_ids as it
                            does _not_ have the same strictness guarantees.

* subversion/libsvn_fs_base/id.c
  (svn_fs_base__id_compare): Update enum element name.

* subversion/libsvn_fs_base/tree.c
  (txn_body_copy): Same.

* subversion/libsvn_fs/editor.c
  (can_modify): Same.

* subversion/libsvn_fs_fs/id.c
  (svn_fs_fs__id_compare): Same.

* subversion/libsvn_fs/fs-loader.c
  (svn_fs_compare_ids): Same.

* subversion/libsvn_fs_fs/tree.c
  (fs_node_relation): Same.

* subversion/libsvn_fs_x/fs_id.c
  (id_compare): Same.

* subversion/libsvn_fs_x/tree.c
  (x_node_relation): Same.

* subversion/libsvn_repos/delta.c
  (svn_repos_dir_delta2): Same.

* subversion/mod_dav_svn/repos.c
  (do_out_of_date_check): Same.

* subversion/mod_dav_svn/util.c
  (dav_svn__get_safe_cr): Same.

* subversion/mod_dav_svn/version.c
  (dav_svn__checkout): Same.

* subversion/tests/libsvn_fs/fs-test.c
  (check_related,
   check_txn_related): Same.

Modified:
    subversion/trunk/subversion/include/svn_fs.h
    subversion/trunk/subversion/libsvn_fs/editor.c
    subversion/trunk/subversion/libsvn_fs/fs-loader.c
    subversion/trunk/subversion/libsvn_fs_base/id.c
    subversion/trunk/subversion/libsvn_fs_base/tree.c
    subversion/trunk/subversion/libsvn_fs_fs/id.c
    subversion/trunk/subversion/libsvn_fs_fs/tree.c
    subversion/trunk/subversion/libsvn_fs_x/fs_id.c
    subversion/trunk/subversion/libsvn_fs_x/tree.c
    subversion/trunk/subversion/libsvn_repos/delta.c
    subversion/trunk/subversion/mod_dav_svn/repos.c
    subversion/trunk/subversion/mod_dav_svn/util.c
    subversion/trunk/subversion/mod_dav_svn/version.c
    subversion/trunk/subversion/tests/libsvn_fs/fs-test.c

Modified: subversion/trunk/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_fs.h?rev=1669746&r1=1669745&r2=1669746&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_fs.h (original)
+++ subversion/trunk/subversion/include/svn_fs.h Sat Mar 28 11:40:46 2015
@@ -888,27 +888,39 @@ svn_fs_access_add_lock_token(svn_fs_acce
  * @{
  */
 
-/** Defines the possible ways two arbitrary node-revisions may be related.
+/** Defines the possible ways two arbitrary (root, path)-pairs may be
+ * related.
  *
  * @since New in 1.9.
  */
 typedef enum svn_fs_node_relation_t
 {
-  /** The node-revisions are not related.
-   * Node-revisions from different repositories are always unrelated.
-   * #svn_fs_compare_ids would return the value -1 in this case.
+  /** The (root, path)-pairs are not related, i.e. none of the other cases
+   * apply.  If the roots refer to different @c svn_fs_t instances, then
+   * they are always considered unrelated - even if the underlying
+   * repository is the same.
    */
   svn_fs_node_unrelated = 0,
 
-  /** They are the same node-revision, i.e. there is no intervening change.
-   * However, due to lazy copying, there may be part of different parent
-   * copies.  #svn_fs_compare_ids would return the value 0 in this case.
+  /** No changes have been made between the (root, path)-pairs, i.e. they
+   * have the same (relative) nodes in their sub-trees, corresponding sub-
+   * tree nodes have the same contents as well as properties and report the
+   * same "created-path" and "created-rev" data.  This implies having a
+   * common ancestor.
+   *
+   * However, due to efficiency considerations, the FS implementation may
+   * report some combinations as merely having a common ancestor
+   * (@a svn_fs_node_common_ancestor) instead of actually being unchanged.
    */
-  svn_fs_node_same,
+  svn_fs_node_unchanged,
 
-  /** The node-revisions have a common ancestor (which may be one of them)
-   * but are not the same.
-   * #svn_fs_compare_ids would return the value 1 in this case.
+  /** The (root, path)-pairs have a common ancestor (which may be one of
+   * them) but there are changes between them, i.e. they don't fall into
+   * the @c svn_fs_node_unchanged category.
+   *
+   * Due to efficiency considerations, the FS implementation may falsely
+   * classify some combinations as merely having a common ancestor that
+   * are, in fact, unchanged (@a svn_fs_node_unchanged).
    */
   svn_fs_node_common_ancestor
 

Modified: subversion/trunk/subversion/libsvn_fs/editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/editor.c?rev=1669746&r1=1669745&r2=1669746&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/editor.c (original)
+++ subversion/trunk/subversion/libsvn_fs/editor.c Sat Mar 28 11:40:46 2015
@@ -249,7 +249,7 @@ can_modify(svn_fs_root_t *txn_root,
       svn_fs_close_root(rev_root);
 
       /* Has the target node changed in the future?  */
-      if (relation != svn_fs_node_same)
+      if (relation != svn_fs_node_unchanged)
         {
           /* Restarting the commit will base the txn on the future/new
              revision, allowing the modification at REVISION.  */

Modified: subversion/trunk/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/fs-loader.c?rev=1669746&r1=1669745&r2=1669746&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/trunk/subversion/libsvn_fs/fs-loader.c Sat Mar 28 11:40:46 2015
@@ -1899,7 +1899,7 @@ svn_fs_compare_ids(const svn_fs_id_t *a,
 {
   switch (a->vtable->compare(a, b))
     {
-    case svn_fs_node_same:
+    case svn_fs_node_unchanged:
       return 0;
     case svn_fs_node_common_ancestor:
       return 1;

Modified: subversion/trunk/subversion/libsvn_fs_base/id.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/id.c?rev=1669746&r1=1669745&r2=1669746&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_base/id.c (original)
+++ subversion/trunk/subversion/libsvn_fs_base/id.c Sat Mar 28 11:40:46 2015
@@ -113,7 +113,7 @@ svn_fs_base__id_compare(const svn_fs_id_
                         const svn_fs_id_t *b)
 {
   if (svn_fs_base__id_eq(a, b))
-    return svn_fs_node_same;
+    return svn_fs_node_unchanged;
   return (svn_fs_base__id_check_related(a, b) ? svn_fs_node_common_ancestor
                                               : svn_fs_node_unrelated);
 }

Modified: subversion/trunk/subversion/libsvn_fs_base/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/tree.c?rev=1669746&r1=1669745&r2=1669746&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_base/tree.c Sat Mar 28 11:40:46 2015
@@ -3164,7 +3164,8 @@ txn_body_copy(void *baton,
   if ((to_parent_path->node)
       && (svn_fs_base__id_compare(svn_fs_base__dag_get_id(from_node),
                                   svn_fs_base__dag_get_id
-                                  (to_parent_path->node)) == svn_fs_node_same))
+                                  (to_parent_path->node))
+          == svn_fs_node_unchanged))
     return SVN_NO_ERROR;
 
   if (! from_root->is_txn_root)

Modified: subversion/trunk/subversion/libsvn_fs_fs/id.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/id.c?rev=1669746&r1=1669745&r2=1669746&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/id.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/id.c Sat Mar 28 11:40:46 2015
@@ -392,7 +392,7 @@ svn_fs_fs__id_compare(const svn_fs_id_t
                       const svn_fs_id_t *b)
 {
   if (svn_fs_fs__id_eq(a, b))
-    return svn_fs_node_same;
+    return svn_fs_node_unchanged;
   return (svn_fs_fs__id_check_related(a, b) ? svn_fs_node_common_ancestor
                                             : svn_fs_node_unrelated);
 }

Modified: subversion/trunk/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/tree.c?rev=1669746&r1=1669745&r2=1669746&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/tree.c Sat Mar 28 11:40:46 2015
@@ -1357,7 +1357,7 @@ fs_node_relation(svn_fs_node_relation_t
       *relation = (   (root_a->rev == root_b->rev)
                    && (root_a->is_txn_root == root_b->is_txn_root)
                    && !different_txn)
-                ? svn_fs_node_same
+                ? svn_fs_node_unchanged
                 : svn_fs_node_common_ancestor;
       return SVN_NO_ERROR;
     }
@@ -1391,7 +1391,7 @@ fs_node_relation(svn_fs_node_relation_t
 
   /* The noderevs are actually related.  Are they the same? */
   if (svn_fs_fs__id_eq(id_a, id_b))
-    *relation = svn_fs_node_same;
+    *relation = svn_fs_node_unchanged;
   else
     *relation = svn_fs_node_common_ancestor;
 

Modified: subversion/trunk/subversion/libsvn_fs_x/fs_id.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/fs_id.c?rev=1669746&r1=1669745&r2=1669746&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/fs_id.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/fs_id.c Sat Mar 28 11:40:46 2015
@@ -217,7 +217,7 @@ id_compare(const svn_fs_id_t *a,
 
   /* Quick check: same IDs? */
   if (svn_fs_x__id_eq(&id_a->noderev_id, &id_b->noderev_id))
-    return svn_fs_node_same;
+    return svn_fs_node_unchanged;
 
   /* Fetch the nodesrevs, compare the IDs of the nodes they belong to and
      clean up any temporaries.  If we can't find one of the noderevs, don't

Modified: subversion/trunk/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/tree.c?rev=1669746&r1=1669745&r2=1669746&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/tree.c Sat Mar 28 11:40:46 2015
@@ -1354,7 +1354,7 @@ x_node_relation(svn_fs_node_relation_t *
       *relation = (   (root_a->rev == root_b->rev)
                    && (root_a->is_txn_root == root_b->is_txn_root)
                    && !different_txn)
-                ? svn_fs_node_same
+                ? svn_fs_node_unchanged
                 : svn_fs_node_common_ancestor;
       return SVN_NO_ERROR;
     }
@@ -1372,7 +1372,7 @@ x_node_relation(svn_fs_node_relation_t *
   /* In FSX, even in-txn IDs are globally unique.
    * So, we can simply compare them. */
   if (svn_fs_x__id_eq(&noderev_id_a, &noderev_id_b))
-    *relation = svn_fs_node_same;
+    *relation = svn_fs_node_unchanged;
   else if (svn_fs_x__id_eq(&node_id_a, &node_id_b))
     *relation = svn_fs_node_common_ancestor;
   else

Modified: subversion/trunk/subversion/libsvn_repos/delta.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/delta.c?rev=1669746&r1=1669745&r2=1669746&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/delta.c (original)
+++ subversion/trunk/subversion/libsvn_repos/delta.c Sat Mar 28 11:40:46 2015
@@ -321,7 +321,7 @@ svn_repos_dir_delta2(svn_fs_root_t *src_
   SVN_ERR(svn_fs_node_relation(&relation, tgt_root, tgt_fullpath,
                                src_root, src_fullpath, pool));
 
-  if (relation == svn_fs_node_same)
+  if (relation == svn_fs_node_unchanged)
     {
       /* They are the same node!  No-op (you gotta love those). */
       goto cleanup;

Modified: subversion/trunk/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/repos.c?rev=1669746&r1=1669745&r2=1669746&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/repos.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/repos.c Sat Mar 28 11:40:46 2015
@@ -1948,7 +1948,7 @@ do_out_of_date_check(dav_resource_combin
                                       r->pool);
         }
 
-      if (node_relation != svn_fs_node_same)
+      if (node_relation != svn_fs_node_unchanged)
         {
           serr = svn_error_createf(SVN_ERR_RA_OUT_OF_DATE, NULL,
                                    "Directory '%s' is out of date",

Modified: subversion/trunk/subversion/mod_dav_svn/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/util.c?rev=1669746&r1=1669745&r2=1669746&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/util.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/util.c Sat Mar 28 11:40:46 2015
@@ -217,7 +217,7 @@ dav_svn__get_safe_cr(svn_fs_root_t *root
       return revision;
     }
 
-  if (node_relation == svn_fs_node_same)
+  if (node_relation == svn_fs_node_unchanged)
     return history_rev;  /* the history rev is safe!  the same node
                             exists at the same path in both revisions. */
 

Modified: subversion/trunk/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/version.c?rev=1669746&r1=1669745&r2=1669746&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/version.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/version.c Sat Mar 28 11:40:46 2015
@@ -751,7 +751,7 @@ dav_svn__checkout(dav_resource *resource
                   svn_error_clear(serr);
                   return err;
                 }
-              if (node_relation != svn_fs_node_same)
+              if (node_relation != svn_fs_node_unchanged)
                 {
                   return dav_svn__new_error_svn
                     (resource->pool, HTTP_CONFLICT, SVN_ERR_FS_CONFLICT,

Modified: subversion/trunk/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs/fs-test.c?rev=1669746&r1=1669745&r2=1669746&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs/fs-test.c Sat Mar 28 11:40:46 2015
@@ -4268,7 +4268,7 @@ check_related(const svn_test_opts_t *opt
             if (i == j)
               {
                 /* Identical note. */
-                if (!related || relation != svn_fs_node_same)
+                if (!related || relation != svn_fs_node_unchanged)
                   {
                     return svn_error_createf
                       (SVN_ERR_TEST_FAILED, NULL,
@@ -4319,7 +4319,7 @@ check_related(const svn_test_opts_t *opt
                                          rev_root, path, subpool));
 
             /* They shall use the same noderevs */
-            if (relation != svn_fs_node_same)
+            if (relation != svn_fs_node_unchanged)
               {
                 return svn_error_createf
                   (SVN_ERR_TEST_FAILED, NULL,
@@ -4486,7 +4486,7 @@ check_txn_related(const svn_test_opts_t
             if (i == j)
               {
                 /* Identical noderev. */
-                if (!related || relation != svn_fs_node_same)
+                if (!related || relation != svn_fs_node_unchanged)
                   {
                     return svn_error_createf
                       (SVN_ERR_TEST_FAILED, NULL,
@@ -4525,7 +4525,7 @@ check_txn_related(const svn_test_opts_t
                                      root[0], "D", subpool));
 
         /* They shall use the same noderevs */
-        if (relation != svn_fs_node_same)
+        if (relation != svn_fs_node_unchanged)
           {
             return svn_error_createf
               (SVN_ERR_TEST_FAILED, NULL,



Mime
View raw message