Author: svn-role
Date: Thu Apr 17 07:46:37 2014
New Revision: 1588150
URL: http://svn.apache.org/r1588150
Log:
Merge the r1578670 group from trunk:
* r1578670, r1578820, r1579274, r1587511
Fix the order of node record headers written by svndumpfilter.
Justification:
Makes output match the rules documented in notes/dump-load-format.txt.
Votes:
+1: philip, julianfoad, rhuijben
Modified:
subversion/branches/1.8.x/ (props changed)
subversion/branches/1.8.x/subversion/svndumpfilter/svndumpfilter.c
subversion/branches/1.8.x/subversion/tests/cmdline/svndumpfilter_tests.py
Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
Merged /subversion/trunk:r1578670,1578820,1579274,1587511
Modified: subversion/branches/1.8.x/subversion/svndumpfilter/svndumpfilter.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/svndumpfilter/svndumpfilter.c?rev=1588150&r1=1588149&r2=1588150&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/svndumpfilter/svndumpfilter.c
(original)
+++ subversion/branches/1.8.x/subversion/svndumpfilter/svndumpfilter.c Thu Apr
17 07:46: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
@@ -623,6 +625,30 @@ new_node_record(void **node_baton,
if (! nb->rb->writing_begun)
SVN_ERR(output_revision(nb->rb));
+ /* A node record is required to begin with 'Node-path', skip the
+ leading '/' to match the form used by 'svnadmin dump'. */
+ SVN_ERR(svn_stream_printf(nb->rb->pb->out_stream,
+ pool, "%s: %s\n",
+ SVN_REPOS_DUMPFILE_NODE_PATH, node_path + 1));
+
+ /* 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);
@@ -638,7 +664,10 @@ 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_TEXT_CONTENT_LENGTH))
+ || (!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.
Modified:
subversion/branches/1.8.x/subversion/tests/cmdline/svndumpfilter_tests.py
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/tests/cmdline/svndumpfilter_tests.py?rev=1588150&r1=1588149&r2=1588150&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/tests/cmdline/svndumpfilter_tests.py
(original)
+++ subversion/branches/1.8.x/subversion/tests/cmdline/svndumpfilter_tests.py
Thu Apr 17 07:46:37 2014
@@ -559,7 +559,7 @@ def dropped_but_not_renumbered_empty_rev
full_dump_contents = open(full_dump).read()
filtered_dumpfile, filtered_out = filter_and_return_output(
full_dump_contents,
- 8192, # Set a sufficiently large bufsize to avoid a deadlock
+ 16384, # Set a sufficiently large bufsize to avoid a deadlock
"exclude", "branches/B2",
"--skip-missing-merge-sources", "--drop-empty-revs")