subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1527079 - /subversion/trunk/subversion/libsvn_fs_fs/tree.c
Date Fri, 27 Sep 2013 21:04:07 GMT
Author: stefan2
Date: Fri Sep 27 21:04:06 2013
New Revision: 1527079

URL: http://svn.apache.org/r1527079
Log:
Clean up is_changed_node() implementation. No functional change.

* subversion/libsvn_fs_fs/tree.c
  (is_changed_node): reformat, add more commentary

Suggested by: ivan

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/tree.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/tree.c?rev=1527079&r1=1527078&r2=1527079&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/tree.c Fri Sep 27 21:04:06 2013
@@ -2423,34 +2423,44 @@ is_changed_node(svn_boolean_t *changed,
   svn_fs_root_t *copy_from_root1, *copy_from_root2;
   const char *copy_from_path1, *copy_from_path2;
 
-  *changed = TRUE;
-
   SVN_ERR(svn_fs_fs__revision_root(&rev_root, root->fs, revision, pool));
 
   /* Get the NODE for FROM_PATH in FROM_ROOT.*/
   SVN_ERR(get_dag(&node, root, path, TRUE, pool));
   SVN_ERR(get_dag(&rev_node, rev_root, path, TRUE, pool));
 
-  /* different ID -> got changed*/
+  /* different ID -> got changed */
   if (!svn_fs_fs__id_eq(svn_fs_fs__dag_get_id(node),
                         svn_fs_fs__dag_get_id(rev_node)))
-    return SVN_NO_ERROR;
+    {
+      *changed = TRUE;
+       return SVN_NO_ERROR;
+    }
 
-  /* some node. might still be a lazy copy */
+  /* same node. might still be a lazy copy with separate history */
   SVN_ERR(fs_closest_copy(&copy_from_root1, &copy_from_path1, root,
                           path, pool));
   SVN_ERR(fs_closest_copy(&copy_from_root2, &copy_from_path2, rev_root,
                           path, pool));
 
-  if ((copy_from_root1 == NULL) != (copy_from_root2 == NULL))
-    return SVN_NO_ERROR;
-
-  if (copy_from_root1)
-    if (   copy_from_root1->rev != copy_from_root2->rev
-        || strcmp(copy_from_path1, copy_from_path2))
-      return SVN_NO_ERROR;
+  if (copy_from_root1 == NULL && copy_from_root2 == NULL)
+    {
+      /* never copied -> same line of history */
+      *changed = FALSE;
+    }
+  else if (copy_from_root1 != NULL && copy_from_root2 != NULL)
+    {
+      /* both got copied. At the same time & location? */
+      *changed = (copy_from_root1->rev != copy_from_root2->rev)
+                 || strcmp(copy_from_path1, copy_from_path2);
+    }
+  else
+    {
+      /* one is a copy while the other one is not
+       * -> different lines of history */
+      *changed = TRUE;
+    }
 
-  *changed = FALSE;
   return SVN_NO_ERROR;
 }
 



Mime
View raw message