You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2014/03/19 17:08:37 UTC

svn commit: r1579274 - /subversion/trunk/subversion/svndumpfilter/svndumpfilter.c

Author: philip
Date: Wed Mar 19 16:08:37 2014
New Revision: 1579274

URL: http://svn.apache.org/r1579274
Log:
Followup to r1578670, more ordering of svndumpfilter output to match
documented format.

Reported by: "Brown, Jonathan W" <JonathanW.Brown{_AT_}nuance.com>

* subversion/svndumpfilter/svndumpfilter.c
  (new_node_record): Correct order for 'Node-kind' and 'Node-action'.

Modified:
    subversion/trunk/subversion/svndumpfilter/svndumpfilter.c

Modified: subversion/trunk/subversion/svndumpfilter/svndumpfilter.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svndumpfilter/svndumpfilter.c?rev=1579274&r1=1579273&r2=1579274&view=diff
==============================================================================
--- subversion/trunk/subversion/svndumpfilter/svndumpfilter.c (original)
+++ subversion/trunk/subversion/svndumpfilter/svndumpfilter.c Wed Mar 19 16:08:37 2014
@@ -570,6 +570,9 @@ new_node_record(void **node_baton,
     }
   else
     {
+      const char *kind;
+      const char *action;
+
       tcl = svn_hash_gets(headers, SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH);
 
       /* Test if this node was copied from dropped source. */
@@ -584,7 +587,6 @@ new_node_record(void **node_baton,
              dumpfile should contain the new contents of the file.  In this
              scenario, we'll just do an add without history using the new
              contents.  */
-          const char *kind;
           kind = svn_hash_gets(headers, SVN_REPOS_DUMPFILE_NODE_KIND);
 
           /* If there is a Text-content-length header, and the kind is
@@ -628,6 +630,24 @@ new_node_record(void **node_baton,
                                 pool, "%s: %s\n",
                                 SVN_REPOS_DUMPFILE_NODE_PATH, node_path));
 
+      /* Node-kind is next and is optional. */
+      kind = svn_hash_gets(headers, SVN_REPOS_DUMPFILE_NODE_KIND);
+      if (kind)
+        SVN_ERR(svn_stream_printf(nb->rb->pb->out_stream,
+                                  pool, "%s: %s\n",
+                                  SVN_REPOS_DUMPFILE_NODE_KIND, kind));
+
+      /* Node-action is next and required. */
+      action = svn_hash_gets(headers, SVN_REPOS_DUMPFILE_NODE_ACTION);
+      if (action)
+        SVN_ERR(svn_stream_printf(nb->rb->pb->out_stream,
+                                  pool, "%s: %s\n",
+                                  SVN_REPOS_DUMPFILE_NODE_ACTION, action));
+      else
+        return svn_error_createf(SVN_ERR_INCOMPLETE_DATA, 0,
+                                 _("Missing Node-action for path '%s'"),
+                                 node_path);
+
       for (hi = apr_hash_first(pool, headers); hi; hi = apr_hash_next(hi))
         {
           const char *key = svn__apr_hash_index_key(hi);
@@ -644,7 +664,9 @@ new_node_record(void **node_baton,
           if ((!strcmp(key, SVN_REPOS_DUMPFILE_CONTENT_LENGTH))
               || (!strcmp(key, SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH))
               || (!strcmp(key, SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH))
-              || (!strcmp(key, SVN_REPOS_DUMPFILE_NODE_PATH)))
+              || (!strcmp(key, SVN_REPOS_DUMPFILE_NODE_PATH))
+              || (!strcmp(key, SVN_REPOS_DUMPFILE_NODE_KIND))
+              || (!strcmp(key, SVN_REPOS_DUMPFILE_NODE_ACTION)))
             continue;
 
           /* Rewrite Node-Copyfrom-Rev if we are renumbering revisions.