subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1579274 - /subversion/trunk/subversion/svndumpfilter/svndumpfilter.c
Date Wed, 19 Mar 2014 16:08:37 GMT
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.



Mime
View raw message