Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 295A29566 for ; Mon, 13 Feb 2012 17:17:40 +0000 (UTC) Received: (qmail 47120 invoked by uid 500); 13 Feb 2012 17:17:39 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 47090 invoked by uid 500); 13 Feb 2012 17:17:39 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 47075 invoked by uid 99); 13 Feb 2012 17:17:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Feb 2012 17:17:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Feb 2012 17:17:37 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 2A9FC238889B for ; Mon, 13 Feb 2012 17:17:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1243614 - /subversion/branches/fix-rdump-editor/subversion/svnrdump/dump_editor.c Date: Mon, 13 Feb 2012 17:17:18 -0000 To: commits@subversion.apache.org From: hwright@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120213171718.2A9FC238889B@eris.apache.org> Author: hwright Date: Mon Feb 13 17:17:17 2012 New Revision: 1243614 URL: http://svn.apache.org/viewvc?rev=1243614&view=rev Log: On the fix-rdump-editor branch: Remove another instance of using the edit baton for "global" state. * subversion/svnrdump/dump_editor.c (dump_node): Take a stream arg, rather an entire baton. (close_directory, close_file): Update callers. Modified: subversion/branches/fix-rdump-editor/subversion/svnrdump/dump_editor.c Modified: subversion/branches/fix-rdump-editor/subversion/svnrdump/dump_editor.c URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svnrdump/dump_editor.c?rev=1243614&r1=1243613&r2=1243614&view=diff ============================================================================== --- subversion/branches/fix-rdump-editor/subversion/svnrdump/dump_editor.c (original) +++ subversion/branches/fix-rdump-editor/subversion/svnrdump/dump_editor.c Mon Feb 13 17:17:17 2012 @@ -319,10 +319,9 @@ do_dump_newlines(struct dump_edit_baton } /* - * Write out a node record for PATH of type KIND under EB->FS_ROOT. - * ACTION describes what is happening to the node (see enum - * svn_node_action). Write record to writable EB->STREAM, using - * EB->BUFFER to write in chunks. + * Write out a node record for PATH of type KIND. ACTION describes what is + * happening to the node (see enum svn_node_action). Write record to + * writable STREAM. * * If the node was itself copied, IS_COPY is TRUE and the * path/revision of the copy source are in COPYFROM_PATH/COPYFROM_REV. @@ -330,7 +329,7 @@ do_dump_newlines(struct dump_edit_baton * node is part of a copied subtree. */ static svn_error_t * -dump_node(struct dump_edit_baton *eb, +dump_node(svn_stream_t *stream, const char *path, /* an absolute path. */ svn_node_kind_t kind, enum svn_node_action action, @@ -349,15 +348,15 @@ dump_node(struct dump_edit_baton *eb, copyfrom_path = svn_relpath_canonicalize(copyfrom_path, pool); /* Node-path: commons/STATUS */ - SVN_ERR(svn_stream_printf(eb->stream, pool, + SVN_ERR(svn_stream_printf(stream, pool, SVN_REPOS_DUMPFILE_NODE_PATH ": %s\n", path)); /* Node-kind: file */ if (kind == svn_node_file) - SVN_ERR(svn_stream_printf(eb->stream, pool, + SVN_ERR(svn_stream_printf(stream, pool, SVN_REPOS_DUMPFILE_NODE_KIND ": file\n")); else if (kind == svn_node_dir) - SVN_ERR(svn_stream_printf(eb->stream, pool, + SVN_ERR(svn_stream_printf(stream, pool, SVN_REPOS_DUMPFILE_NODE_KIND ": dir\n")); @@ -368,7 +367,7 @@ dump_node(struct dump_edit_baton *eb, /* We are here after a change_file_prop or change_dir_prop. They set up whatever dump_props they needed to- nothing to do here but print node action information */ - SVN_ERR(svn_stream_printf(eb->stream, pool, + SVN_ERR(svn_stream_printf(stream, pool, SVN_REPOS_DUMPFILE_NODE_ACTION ": change\n")); break; @@ -377,7 +376,7 @@ dump_node(struct dump_edit_baton *eb, if (!is_copy) { /* Node-action: replace */ - SVN_ERR(svn_stream_printf(eb->stream, pool, + SVN_ERR(svn_stream_printf(stream, pool, SVN_REPOS_DUMPFILE_NODE_ACTION ": replace\n")); break; @@ -386,12 +385,12 @@ dump_node(struct dump_edit_baton *eb, copyfrom_rev are present: delete the original, and then re-add it */ - SVN_ERR(svn_stream_printf(eb->stream, pool, + SVN_ERR(svn_stream_printf(stream, pool, SVN_REPOS_DUMPFILE_NODE_ACTION ": delete\n\n")); /* Recurse: Print an additional add-with-history record. */ - SVN_ERR(dump_node(eb, path, kind, svn_node_action_add, props, + SVN_ERR(dump_node(stream, path, kind, svn_node_action_add, props, deleted_props, is_copy, copyfrom_path, copyfrom_rev, pool)); @@ -400,21 +399,21 @@ dump_node(struct dump_edit_baton *eb, break; case svn_node_action_delete: - SVN_ERR(svn_stream_printf(eb->stream, pool, + SVN_ERR(svn_stream_printf(stream, pool, SVN_REPOS_DUMPFILE_NODE_ACTION ": delete\n")); /* We can leave this routine quietly now. Nothing more to do- print a couple of newlines because we're not dumping props or text. */ - SVN_ERR(svn_stream_printf(eb->stream, pool, "\n\n")); + SVN_ERR(svn_stream_printf(stream, pool, "\n\n")); break; case svn_node_action_add: - SVN_ERR(svn_stream_printf(eb->stream, pool, + SVN_ERR(svn_stream_printf(stream, pool, SVN_REPOS_DUMPFILE_NODE_ACTION ": add\n")); - SVN_ERR(svn_stream_printf(eb->stream, pool, + SVN_ERR(svn_stream_printf(stream, pool, SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV ": %ld\n" SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH @@ -530,12 +529,7 @@ close_directory(void *dir_baton, LDR_DBG(("close_directory %p\n", dir_baton)); - /* Some pending properties to dump? */ - /*SVN_ERR(do_dump_props(&eb->propstring, eb->stream, - eb->props, eb->deleted_props, - &(eb->dump_props), TRUE, pool, pool));*/ - - SVN_ERR(dump_node(db->eb, db->abspath, svn_node_dir, + SVN_ERR(dump_node(db->eb->stream, db->abspath, svn_node_dir, svn_node_action_change, db->props, db->deleted_props, db->is_copy, db->copyfrom_path, db->copyfrom_rev, pool)); @@ -546,7 +540,8 @@ close_directory(void *dir_baton, { const char *path = svn__apr_hash_index_key(hi); - SVN_ERR(dump_node(db->eb, path, svn_node_unknown, svn_node_action_delete, + SVN_ERR(dump_node(db->eb->stream, path, svn_node_unknown, + svn_node_action_delete, NULL, NULL, FALSE, NULL, SVN_INVALID_REVNUM, pool)); } @@ -750,7 +745,7 @@ close_file(void *file_baton, val = apr_hash_get(fb->pb->deleted_entries, fb->path, APR_HASH_KEY_STRING); /* Dump the node. */ - SVN_ERR(dump_node(fb->eb, fb->path, + SVN_ERR(dump_node(fb->eb->stream, fb->path, svn_node_file, val ? svn_node_action_replace : svn_node_action_add, fb->props, fb->deleted_props,