Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DBAF8200C05 for ; Mon, 23 Jan 2017 20:32:07 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id DA890160B49; Mon, 23 Jan 2017 19:32:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 08175160B3C for ; Mon, 23 Jan 2017 20:32:06 +0100 (CET) Received: (qmail 96808 invoked by uid 500); 23 Jan 2017 19:32:01 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Received: (qmail 96784 invoked by uid 99); 23 Jan 2017 19:32:00 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2017 19:32:00 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 82D0AC08D3 for ; Mon, 23 Jan 2017 19:32:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.73 X-Spam-Level: * X-Spam-Status: No, score=1.73 tagged_above=-999 required=6.31 tests=[KAM_INFOUSMEBIZ=0.75, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id o8WOIwcXKHVJ for ; Mon, 23 Jan 2017 19:31:59 +0000 (UTC) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 4B2075F23A for ; Mon, 23 Jan 2017 19:31:58 +0000 (UTC) X-MHO-User: 85eaa506-e1a2-11e6-acc0-c7e6c9ad01d6 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 38.111.151.67 X-Mail-Handler: DuoCircle Outbound SMTP Received: from PerkinsLT6 (unknown [38.111.151.67]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 85eaa506-e1a2-11e6-acc0-c7e6c9ad01d6; Mon, 23 Jan 2017 19:31:23 +0000 (UTC) Reply-To: From: "Luke Perkins" To: Subject: [PATCH] Issue #4668: Fixing the node key order during svnadmin dump Date: Mon, 23 Jan 2017 11:31:54 -0800 Message-ID: <003001d275af$5afca8c0$10f5fa40$@epicdgs.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0031_01D2756C.4CD9B6E0" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdJ1rX3ySWIu/87lSYO5bjNLndMKEQ== Content-Language: en-us archived-at: Mon, 23 Jan 2017 19:32:08 -0000 This is a multipart message in MIME format. ------=_NextPart_000_0031_01D2756C.4CD9B6E0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit [[[ Fix issue #4668: svnadmin dump node header order has changed These changes provide a means for the user to output the svnadmin dump using the node key order used in svnadmin version 1.8 and earlier. * subversion/include/svn_repos.h Added comment regarding the switch usage. (svn_repos_dump_fs4): Added Boolean parameter to function prototype called pre_1_8_dump * subversion/svnadmin/svnadmin.c (svnadmin_cmdline_options_t ): Added svnadmin__pre_1_8_dump to enumerated definition. (options_table): Added pre_1_8_dump definition to the table. (cmd_table ): Modified the help usage text to include the pre-1.8-dump switch. (svnadmin_opt_state ): Added pre_1_8_dump boolean member to structure definition. (subcommand_dump): Added pre_1_8_dump variable to svn_repos_dump_fs4 function call. (sub_main): Added case supporting svnadmin__pre_1_8_dump value. * subversion/libsvn_repos/dump.c (write_revision_headers, write_revision_headers_v1651614 ): Renamed original write_revision_headers function to write_revision_headers_v1651614. (write_revision_headers_svn_4668): Added new function with fixed node key ordering as prescribed in the prose of Issue 4668. (write_revision_headers): Modified function to switch between two node key formatting methods. (svn_repos__dump_revision_record, write_revision_record, svn_repos_dump_fs4): Added pre_1_8_dump parameter to define the node key ordering during svnadmin dump operations. Patch by: L. Perkins len)); - SVN_ERR(write_revision_headers(dump_stream, headers, scratch_pool)); + SVN_ERR(write_revision_headers(dump_stream, headers, scratch_pool, = pre_1_8_dump)); =20 /* End of headers */ SVN_ERR(svn_stream_puts(dump_stream, "\n")); @@ -1926,7 +2005,9 @@ write_revision_record(svn_stream_t *stream, svn_fs_t *fs, svn_revnum_t rev, svn_boolean_t include_revprops, - apr_pool_t *pool) + apr_pool_t *pool, + svn_boolean_t pre_1_8_dump + ) { apr_hash_t *props; apr_time_t timetemp; @@ -1957,7 +2038,8 @@ write_revision_record(svn_stream_t *stream, =20 SVN_ERR(svn_repos__dump_revision_record(stream, rev, NULL, props, include_revprops, - pool)); + pool, + pre_1_8_dump)); return SVN_NO_ERROR; } =20 @@ -1973,6 +2055,7 @@ svn_repos_dump_fs4(svn_repos_t *repos, svn_boolean_t use_deltas, svn_boolean_t include_revprops, svn_boolean_t include_changes, + svn_boolean_t pre_1_8_dump, svn_repos_notify_func_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, @@ -2054,7 +2137,7 @@ svn_repos_dump_fs4(svn_repos_t *repos, =20 /* Write the revision record. */ SVN_ERR(write_revision_record(stream, fs, rev, include_revprops, - iterpool)); + iterpool, pre_1_8_dump)); =20 /* When dumping revision 0, we just write out the revision = record. The parser might want to use its properties. Index: subversion/subversion/svnadmin/svnadmin.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- subversion/subversion/svnadmin/svnadmin.c (revision 1779962) +++ subversion/subversion/svnadmin/svnadmin.c (working copy) @@ -150,7 +150,8 @@ enum svnadmin__cmdline_options_t svnadmin__compatible_version, svnadmin__check_normalization, svnadmin__metadata_only, - svnadmin__no_flush_to_disk + svnadmin__no_flush_to_disk, + svnadmin__pre_1_8_dump }; =20 /* Option codes and descriptions. @@ -273,6 +274,10 @@ static const apr_getopt_option_t options_table[] = =3D N_("disable flushing to disk during the operation\n" " (faster, but unsafe on power = off)")}, =20 + {"pre-1.8-dump", svnadmin__pre_1_8_dump, 0, + N_("the dump file will order certain keys in version 1.8 or = older\n" + " format.\n")}, + {NULL} }; =20 @@ -320,7 +325,7 @@ static const svn_opt_subcommand_desc2_t cmd_table[ {'r', 'q', 'M'} }, =20 {"dump", subcommand_dump, {0}, N_ - ("usage: svnadmin dump REPOS_PATH [-r LOWER[:UPPER] = [--incremental]]\n\n" + ("usage: svnadmin dump REPOS_PATH [-r LOWER[:UPPER] [--incremental]] = [--pre-1.8-dump]\n\n" "Dump the contents of filesystem to stdout in a 'dumpfile'\n" "portable format, sending feedback to stderr. Dump revisions\n" "LOWER rev through UPPER rev. If no revisions are given, dump = all\n" @@ -329,7 +334,9 @@ static const svn_opt_subcommand_desc2_t cmd_table[ "only the paths changed in that revision; otherwise it will = describe\n" "every path present in the repository as of that revision. (In = either\n" "case, the second and subsequent revisions, if any, describe only = paths\n" - "changed in those revisions.)\n"), + "changed in those revisions.)\n" + "--pre-1.8-dump preserves the node key order as defined in 1.8 = and\n" + "and earlier releases\n"), {'r', svnadmin__incremental, svnadmin__deltas, 'q', 'M', 'F'}, {{'F', N_("write to file ARG instead of stdout")}} }, =20 @@ -546,6 +553,7 @@ struct svnadmin_opt_state svn_boolean_t bypass_prop_validation; /* = --bypass-prop-validation */ svn_boolean_t ignore_dates; /* --ignore-dates = */ svn_boolean_t no_flush_to_disk; /* = --no-flush-to-disk */ + svn_boolean_t pre_1_8_dump; /* --pre-1.8-dump = */ enum svn_repos_load_uuid uuid_action; /* --ignore-uuid, --force-uuid */ apr_uint64_t memory_cache_size; /* = --memory-cache-size M */ @@ -1270,7 +1278,7 @@ subcommand_dump(apr_getopt_t *os, void *baton, apr =20 SVN_ERR(svn_repos_dump_fs4(repos, out_stream, lower, upper, opt_state->incremental, = opt_state->use_deltas, - TRUE, TRUE, + TRUE, TRUE, opt_state->pre_1_8_dump, !opt_state->quiet ? repos_notify_handler : = NULL, feedback_stream, check_cancel, NULL, = pool)); =20 @@ -2861,6 +2869,9 @@ sub_main(int *exit_code, int argc, const char *arg case svnadmin__no_flush_to_disk: opt_state.no_flush_to_disk =3D TRUE; break; + case svnadmin__pre_1_8_dump: + opt_state.pre_1_8_dump =3D TRUE; + break; default: { SVN_ERR(subcommand_help(NULL, NULL, pool)); ------=_NextPart_000_0031_01D2756C.4CD9B6E0--