subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1595344 - in /subversion/trunk/subversion/libsvn_fs_x: ./ dag.c dag.h low_level.c transaction.c transaction.h tree.c
Date Fri, 16 May 2014 20:54:53 GMT
Author: stefan2
Date: Fri May 16 20:54:53 2014
New Revision: 1595344

URL: http://svn.apache.org/r1595344
Log:
Sync'ing FSX with FSFS:
Merge r1559912,1560107,1586947,1586953 from /subversion/libsvn_fs_fs
into subversion/libsvn_fs_x.  Conflicts were due to name and structural
differences between FSX and FSFS.

This ports the 'svn log' related changes.

Modified:
    subversion/trunk/subversion/libsvn_fs_x/   (props changed)
    subversion/trunk/subversion/libsvn_fs_x/dag.c
    subversion/trunk/subversion/libsvn_fs_x/dag.h
    subversion/trunk/subversion/libsvn_fs_x/low_level.c
    subversion/trunk/subversion/libsvn_fs_x/transaction.c
    subversion/trunk/subversion/libsvn_fs_x/transaction.h
    subversion/trunk/subversion/libsvn_fs_x/tree.c

Propchange: subversion/trunk/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
  Merged /subversion/trunk/subversion/libsvn_fs_fs:r1559912,1560107,1586947,1586953

Modified: subversion/trunk/subversion/libsvn_fs_x/dag.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/dag.c?rev=1595344&r1=1595343&r2=1595344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.c Fri May 16 20:54:53 2014
@@ -684,6 +684,10 @@ svn_fs_x__dag_clone_child(dag_node_t **c
 
   /* Find the node named NAME in PARENT's entries list if it exists. */
   SVN_ERR(svn_fs_x__dag_open(&cur_entry, parent, name, pool, subpool));
+  if (! cur_entry)
+    return svn_error_createf
+      (SVN_ERR_FS_NOT_FOUND, NULL,
+       "Attempted to open non-existent child node '%s'", name);
 
   /* Check for mutability in the node we found.  If it's mutable, we
      don't need to clone it. */
@@ -1174,9 +1178,10 @@ svn_fs_x__dag_open(dag_node_t **child_p,
   SVN_ERR(dir_entry_id_from_node(&node_id, parent, name,
                                  scratch_pool, scratch_pool));
   if (! node_id)
-    return svn_error_createf
-      (SVN_ERR_FS_NOT_FOUND, NULL,
-       "Attempted to open non-existent child node '%s'", name);
+    {
+      *child_p = NULL;
+      return SVN_NO_ERROR;
+    }
 
   /* Make sure that NAME is a single path component. */
   if (! svn_path_is_single_path_component(name))

Modified: subversion/trunk/subversion/libsvn_fs_x/dag.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/dag.h?rev=1595344&r1=1595343&r2=1595344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.h Fri May 16 20:54:53 2014
@@ -254,7 +254,8 @@ svn_error_t *svn_fs_x__dag_clone_root(da
 
 /* Open the node named NAME in the directory PARENT.  Set *CHILD_P to
    the new node, allocated in RESULT_POOL.  NAME must be a single path
-   component; it cannot be a slash-separated directory path.
+   component; it cannot be a slash-separated directory path.  If NAME does
+   not exist within PARENT, set *CHILD_P to NULL.
  */
 svn_error_t *
 svn_fs_x__dag_open(dag_node_t **child_p,

Modified: subversion/trunk/subversion/libsvn_fs_x/low_level.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/low_level.c?rev=1595344&r1=1595343&r2=1595344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/low_level.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/low_level.c Fri May 16 20:54:53 2014
@@ -862,6 +862,26 @@ read_change(change_t **change_p,
                               _("Invalid prop-mod flag in rev-file"));
     }
 
+  /* Get the mergeinfo-mod flag. */
+  str = svn_cstring_tokenize(" ", &last_str);
+  if (str == NULL)
+    return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
+                            _("Invalid changes line in rev-file"));
+
+  if (strcmp(str, FLAG_TRUE) == 0)
+    {
+      info->mergeinfo_mod = svn_tristate_true;
+    }
+  else if (strcmp(str, FLAG_FALSE) == 0)
+    {
+      info->mergeinfo_mod = svn_tristate_false;
+    }
+  else
+    {
+      return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
+                              _("Invalid mergeinfo-mod flag in rev-file"));
+    }
+
   /* Get the changed path. */
   change->path.data = auto_unescape_path(apr_pstrmemdup(pool, last_str,
                                                         strlen(last_str)),
@@ -974,10 +994,12 @@ write_change_entry(svn_stream_t *stream,
                               change->node_kind == svn_node_dir
                               ? SVN_FS_X__KIND_DIR
                               : SVN_FS_X__KIND_FILE);
-  buf = svn_stringbuf_createf(pool, "%s %s%s %s %s %s\n",
+  buf = svn_stringbuf_createf(pool, "%s %s%s %s %s %s %s\n",
                               idstr, change_string, kind_string,
                               change->text_mod ? FLAG_TRUE : FLAG_FALSE,
                               change->prop_mod ? FLAG_TRUE : FLAG_FALSE,
+                              change->mergeinfo_mod == svn_tristate_true
+                                               ? FLAG_TRUE : FLAG_FALSE,
                               auto_escape_path(path, pool));
 
   if (SVN_IS_VALID_REVNUM(change->copyfrom_rev))

Modified: subversion/trunk/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/transaction.c?rev=1595344&r1=1595343&r2=1595344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/transaction.c Fri May 16 20:54:53 2014
@@ -885,6 +885,7 @@ replace_change(svn_fs_path_change2_t *ol
   old_change->node_rev_id = svn_fs_x__id_copy(new_change->node_rev_id, pool);
   old_change->text_mod = new_change->text_mod;
   old_change->prop_mod = new_change->prop_mod;
+  old_change->mergeinfo_mod = new_change->mergeinfo_mod;
   if (new_change->copyfrom_rev == SVN_INVALID_REVNUM)
     {
       old_change->copyfrom_rev = SVN_INVALID_REVNUM;
@@ -979,6 +980,7 @@ fold_change(apr_hash_t *changes,
               old_change->change_kind = svn_fs_path_change_delete;
               old_change->text_mod = info->text_mod;
               old_change->prop_mod = info->prop_mod;
+              old_change->mergeinfo_mod = info->mergeinfo_mod;
               old_change->copyfrom_rev = SVN_INVALID_REVNUM;
               old_change->copyfrom_path = NULL;
             }
@@ -1006,6 +1008,8 @@ fold_change(apr_hash_t *changes,
             old_change->text_mod = TRUE;
           if (info->prop_mod)
             old_change->prop_mod = TRUE;
+          if (info->mergeinfo_mod)
+            old_change->mergeinfo_mod = svn_tristate_true;
           break;
         }
 
@@ -1821,6 +1825,7 @@ svn_fs_x__add_change(svn_fs_t *fs,
                      svn_fs_path_change_kind_t change_kind,
                      svn_boolean_t text_mod,
                      svn_boolean_t prop_mod,
+                     svn_boolean_t mergeinfo_mod,
                      svn_node_kind_t node_kind,
                      svn_revnum_t copyfrom_rev,
                      const char *copyfrom_path,
@@ -1839,6 +1844,9 @@ svn_fs_x__add_change(svn_fs_t *fs,
   change = svn_fs__path_change_create_internal(id, change_kind, pool);
   change->text_mod = text_mod;
   change->prop_mod = prop_mod;
+  change->mergeinfo_mod = mergeinfo_mod
+                        ? svn_tristate_true
+                        : svn_tristate_false;
   change->node_kind = node_kind;
   change->copyfrom_rev = copyfrom_rev;
   change->copyfrom_path = apr_pstrdup(pool, copyfrom_path);

Modified: subversion/trunk/subversion/libsvn_fs_x/transaction.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/transaction.h?rev=1595344&r1=1595343&r2=1595344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/transaction.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/transaction.h Fri May 16 20:54:53 2014
@@ -180,12 +180,12 @@ svn_fs_x__set_entry(svn_fs_t *fs,
 
 /* Add a change to the changes record for filesystem FS in transaction
    TXN_ID.  Mark path PATH, having node-id ID, as changed according to
-   the type in CHANGE_KIND.  If the text representation was changed
-   set TEXT_MOD to TRUE, and likewise for PROP_MOD.  If this change
-   was the result of a copy, set COPYFROM_REV and COPYFROM_PATH to the
-   revision and path of the copy source, otherwise they should be set
-   to SVN_INVALID_REVNUM and NULL.  Perform any temporary allocations
-   from POOL. */
+   the type in CHANGE_KIND.  If the text representation was changed set
+   TEXT_MOD to TRUE, and likewise for PROP_MOD as well as MERGEINFO_MOD.
+   If this change was the result of a copy, set COPYFROM_REV and
+   COPYFROM_PATH to the revision and path of the copy source, otherwise
+   they should be set to SVN_INVALID_REVNUM and NULL.  Perform any
+   temporary allocations from POOL. */
 svn_error_t *
 svn_fs_x__add_change(svn_fs_t *fs,
                      svn_fs_x__txn_id_t txn_id,
@@ -194,6 +194,7 @@ svn_fs_x__add_change(svn_fs_t *fs,
                      svn_fs_path_change_kind_t change_kind,
                      svn_boolean_t text_mod,
                      svn_boolean_t prop_mod,
+                     svn_boolean_t mergeinfo_mod,
                      svn_node_kind_t node_kind,
                      svn_revnum_t copyfrom_rev,
                      const char *copyfrom_path,

Modified: subversion/trunk/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/tree.c?rev=1595344&r1=1595343&r2=1595344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/tree.c Fri May 16 20:54:53 2014
@@ -877,7 +877,11 @@ typedef enum open_path_flags_t {
 
   /* The caller does not care about the parent node chain but only
      the final DAG node. */
-  open_path_node_only = 4
+  open_path_node_only = 4,
+
+  /* The caller wants a NULL path object instead of an error if the
+     path cannot be found. */
+  open_path_allow_null = 8
 } open_path_flags_t;
 
 
@@ -996,7 +1000,6 @@ open_path(parent_path_t **parent_path_p,
         {
           copy_id_inherit_t inherit;
           const char *copy_path = NULL;
-          svn_error_t *err = SVN_NO_ERROR;
           dag_node_t *cached_node = NULL;
 
           /* If we found a directory entry, follow it.  First, we
@@ -1010,17 +1013,15 @@ open_path(parent_path_t **parent_path_p,
           if (cached_node)
             child = cached_node;
           else
-            err = svn_fs_x__dag_open(&child, here, entry, pool, iterpool);
+            SVN_ERR(svn_fs_x__dag_open(&child, here, entry, pool, iterpool));
 
           /* "file not found" requires special handling.  */
-          if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND)
+          if (child == NULL)
             {
               /* If this was the last path component, and the caller
                  said it was optional, then don't return an error;
                  just put a NULL node pointer in the path.  */
 
-              svn_error_clear(err);
-
               if ((flags & open_path_last_optional)
                   && (! next || *next == '\0'))
                 {
@@ -1028,6 +1029,11 @@ open_path(parent_path_t **parent_path_p,
                                                  pool);
                   break;
                 }
+              else if (flags & open_path_allow_null)
+                {
+                  parent_path = NULL;
+                  break;
+                }
               else
                 {
                   /* Build a better error message than svn_fs_x__dag_open
@@ -1036,9 +1042,6 @@ open_path(parent_path_t **parent_path_p,
                 }
             }
 
-          /* Other errors we return normally.  */
-          SVN_ERR(err);
-
           if (flags & open_path_node_only)
             {
               /* Shortcut: the caller only wan'ts the final DAG node. */
@@ -1238,11 +1241,11 @@ get_dag(dag_node_t **dag_node_p,
 /* Add a change to the changes table in FS, keyed on transaction id
    TXN_ID, and indicated that a change of kind CHANGE_KIND occurred on
    PATH (whose node revision id is--or was, in the case of a
-   deletion--NODEREV_ID), and optionally that TEXT_MODs or PROP_MODs
-   occurred.  If the change resulted from a copy, COPYFROM_REV and
-   COPYFROM_PATH specify under which revision and path the node was
-   copied from.  If this was not part of a copy, COPYFROM_REV should
-   be SVN_INVALID_REVNUM.  Do all this as part of POOL.  */
+   deletion--NODEREV_ID), and optionally that TEXT_MODs, PROP_MODs or
+   MERGEINFO_MODs occurred.  If the change resulted from a copy,
+   COPYFROM_REV and COPYFROM_PATH specify under which revision and path
+   the node was copied from.  If this was not part of a copy, COPYFROM_REV
+   should be SVN_INVALID_REVNUM.  Do all this as part of POOL.  */
 static svn_error_t *
 add_change(svn_fs_t *fs,
            svn_fs_x__txn_id_t txn_id,
@@ -1251,6 +1254,7 @@ add_change(svn_fs_t *fs,
            svn_fs_path_change_kind_t change_kind,
            svn_boolean_t text_mod,
            svn_boolean_t prop_mod,
+           svn_boolean_t mergeinfo_mod,
            svn_node_kind_t node_kind,
            svn_revnum_t copyfrom_rev,
            const char *copyfrom_path,
@@ -1258,7 +1262,8 @@ add_change(svn_fs_t *fs,
 {
   return svn_fs_x__add_change(fs, txn_id,
                               svn_fs__canonicalize_abspath(path, pool),
-                              noderev_id, change_kind, text_mod, prop_mod,
+                              noderev_id, change_kind,
+                              text_mod, prop_mod, mergeinfo_mod,
                               node_kind, copyfrom_rev, copyfrom_path,
                               pool);
 }
@@ -1504,6 +1509,7 @@ x_change_node_prop(svn_fs_root_t *root,
   parent_path_t *parent_path;
   apr_hash_t *proplist;
   svn_fs_x__txn_id_t txn_id;
+  svn_boolean_t modeinfo_mod = FALSE;
 
   if (! root->is_txn_root)
     return SVN_FS__NOT_TXN(root);
@@ -1546,6 +1552,8 @@ x_change_node_prop(svn_fs_root_t *root,
           SVN_ERR(svn_fs_x__dag_set_has_mergeinfo(parent_path->node,
                                                   (value != NULL), pool));
         }
+
+      modeinfo_mod = TRUE;
     }
 
   /* Set the property. */
@@ -1558,7 +1566,7 @@ x_change_node_prop(svn_fs_root_t *root,
   /* Make a record of this modification in the changes table. */
   return add_change(root->fs, txn_id, path,
                     svn_fs_x__dag_get_id(parent_path->node),
-                    svn_fs_path_change_modify, FALSE, TRUE,
+                    svn_fs_path_change_modify, FALSE, TRUE, modeinfo_mod,
                     svn_fs_x__dag_node_kind(parent_path->node),
                     SVN_INVALID_REVNUM, NULL, pool);
 }
@@ -2360,8 +2368,8 @@ x_make_dir(svn_fs_root_t *root,
 
   /* Make a record of this modification in the changes table. */
   return add_change(root->fs, txn_id, path, svn_fs_x__dag_get_id(sub_dir),
-                    svn_fs_path_change_add, FALSE, FALSE, svn_node_dir,
-                    SVN_INVALID_REVNUM, NULL, pool);
+                    svn_fs_path_change_add, FALSE, FALSE, FALSE,
+                    svn_node_dir, SVN_INVALID_REVNUM, NULL, pool);
 }
 
 
@@ -2417,7 +2425,7 @@ x_delete_node(svn_fs_root_t *root,
   /* Make a record of this modification in the changes table. */
   return add_change(root->fs, txn_id, path,
                     svn_fs_x__dag_get_id(parent_path->node),
-                    svn_fs_path_change_delete, FALSE, FALSE, kind,
+                    svn_fs_path_change_delete, FALSE, FALSE, FALSE, kind,
                     SVN_INVALID_REVNUM, NULL, pool);
 }
 
@@ -2658,8 +2666,8 @@ copy_helper(svn_fs_root_t *from_root,
       /* Make a record of this modification in the changes table. */
       SVN_ERR(get_dag(&new_node, to_root, to_path, TRUE, pool));
       SVN_ERR(add_change(to_root->fs, txn_id, to_path,
-                         svn_fs_x__dag_get_id(new_node), kind, FALSE, FALSE,
-                         svn_fs_x__dag_node_kind(from_node),
+                         svn_fs_x__dag_get_id(new_node), kind, FALSE,
+                         FALSE, FALSE, svn_fs_x__dag_node_kind(from_node),
                          from_root->rev, from_canonpath, pool));
     }
   else
@@ -2808,8 +2816,8 @@ x_make_file(svn_fs_root_t *root,
 
   /* Make a record of this modification in the changes table. */
   return add_change(root->fs, txn_id, path, svn_fs_x__dag_get_id(child),
-                    svn_fs_path_change_add, TRUE, FALSE, svn_node_file,
-                    SVN_INVALID_REVNUM, NULL, pool);
+                    svn_fs_path_change_add, TRUE, FALSE, FALSE,
+                    svn_node_file, SVN_INVALID_REVNUM, NULL, pool);
 }
 
 
@@ -3008,8 +3016,8 @@ apply_textdelta(void *baton, apr_pool_t 
   /* Make a record of this modification in the changes table. */
   return add_change(tb->root->fs, txn_id, tb->path,
                     svn_fs_x__dag_get_id(tb->node),
-                    svn_fs_path_change_modify, TRUE, FALSE, svn_node_file,
-                    SVN_INVALID_REVNUM, NULL, pool);
+                    svn_fs_path_change_modify, TRUE, FALSE, FALSE,
+                    svn_node_file, SVN_INVALID_REVNUM, NULL, pool);
 }
 
 
@@ -3143,8 +3151,8 @@ apply_text(void *baton, apr_pool_t *pool
   /* Make a record of this modification in the changes table. */
   return add_change(tb->root->fs, txn_id, tb->path,
                     svn_fs_x__dag_get_id(tb->node),
-                    svn_fs_path_change_modify, TRUE, FALSE, svn_node_file,
-                    SVN_INVALID_REVNUM, NULL, pool);
+                    svn_fs_path_change_modify, TRUE, FALSE, FALSE,
+                    svn_node_file, SVN_INVALID_REVNUM, NULL, pool);
 }
 
 
@@ -3373,7 +3381,6 @@ svn_error_t *x_closest_copy(svn_fs_root_
   const char *copy_dst_path;
   svn_fs_root_t *copy_dst_root;
   dag_node_t *copy_dst_node;
-  svn_node_kind_t kind;
 
   /* Initialize return values. */
   *root_p = NULL;
@@ -3394,11 +3401,11 @@ svn_error_t *x_closest_copy(svn_fs_root_
      revision between COPY_DST_REV and REV.  Make sure that PATH
      exists as of COPY_DST_REV and is related to this node-rev. */
   SVN_ERR(svn_fs_x__revision_root(&copy_dst_root, fs, copy_dst_rev, pool));
-  SVN_ERR(svn_fs_x__check_path(&kind, copy_dst_root, path, pool));
-  if (kind == svn_node_none)
-    return SVN_NO_ERROR;
   SVN_ERR(open_path(&copy_dst_parent_path, copy_dst_root, path,
-                    open_path_node_only, FALSE, pool));
+                    open_path_node_only | open_path_allow_null, FALSE, pool));
+  if (copy_dst_parent_path == NULL)
+    return SVN_NO_ERROR;
+
   copy_dst_node = copy_dst_parent_path->node;
   if (! svn_fs_x__id_check_related(svn_fs_x__dag_get_id(copy_dst_node),
                                    svn_fs_x__dag_get_id(parent_path->node)))



Mime
View raw message