aboutsummaryrefslogtreecommitdiffstats
path: root/subversion/svndumpfilter/svndumpfilter.c
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/svndumpfilter/svndumpfilter.c')
-rw-r--r--subversion/svndumpfilter/svndumpfilter.c58
1 files changed, 31 insertions, 27 deletions
diff --git a/subversion/svndumpfilter/svndumpfilter.c b/subversion/svndumpfilter/svndumpfilter.c
index b17ccd2e6588..a948b3a4ceaa 100644
--- a/subversion/svndumpfilter/svndumpfilter.c
+++ b/subversion/svndumpfilter/svndumpfilter.c
@@ -43,6 +43,7 @@
#include "svn_mergeinfo.h"
#include "svn_version.h"
+#include "private/svn_dirent_uri_private.h"
#include "private/svn_repos_private.h"
#include "private/svn_mergeinfo_private.h"
#include "private/svn_cmdline_private.h"
@@ -271,9 +272,7 @@ magic_header_record(int version, void *parse_baton, apr_pool_t *pool)
if (version >= SVN_REPOS_DUMPFILE_FORMAT_VERSION_DELTAS)
pb->allow_deltas = TRUE;
- SVN_ERR(svn_stream_printf(pb->out_stream, pool,
- SVN_REPOS_DUMPFILE_MAGIC_HEADER ": %d\n\n",
- version));
+ SVN_ERR(svn_repos__dump_magic_header_record(pb->out_stream, version, pool));
return SVN_NO_ERROR;
}
@@ -446,8 +445,8 @@ static svn_error_t *
uuid_record(const char *uuid, void *parse_baton, apr_pool_t *pool)
{
struct parse_baton_t *pb = parse_baton;
- SVN_ERR(svn_stream_printf(pb->out_stream, pool,
- SVN_REPOS_DUMPFILE_UUID ": %s\n\n", uuid));
+
+ SVN_ERR(svn_repos__dump_uuid_header_record(pb->out_stream, uuid, pool));
return SVN_NO_ERROR;
}
@@ -530,7 +529,8 @@ new_node_record(void **node_baton,
{
return svn_error_createf
(SVN_ERR_INCOMPLETE_DATA, 0,
- _("Invalid copy source path '%s'"), copyfrom_path);
+ _("Invalid copy source path '%s' for '%s'"),
+ copyfrom_path, node_path);
}
}
@@ -611,7 +611,8 @@ new_node_record(void **node_baton,
if (! (cf_renum_val && SVN_IS_VALID_REVNUM(cf_renum_val->rev)))
return svn_error_createf
(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
- _("No valid copyfrom revision in filtered stream"));
+ _("No valid copyfrom revision in filtered stream for '%s'"),
+ node_path);
svn_repos__dumpfile_header_pushf(
nb->headers, SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV,
"%ld", cf_renum_val->rev);
@@ -977,32 +978,35 @@ static const apr_getopt_option_t options_table[] =
/* Array of available subcommands.
* The entire list must be terminated with an entry of nulls.
*/
-static const svn_opt_subcommand_desc2_t cmd_table[] =
+static const svn_opt_subcommand_desc3_t cmd_table[] =
{
- {"exclude", subcommand_exclude, {0},
- N_("Filter out nodes with given prefixes from dumpstream.\n"
- "usage: svndumpfilter exclude PATH_PREFIX...\n"),
+ {"exclude", subcommand_exclude, {0}, {N_(
+ "Filter out nodes with given prefixes from dumpstream.\n"
+ "usage: svndumpfilter exclude PATH_PREFIX...\n"
+ )},
{svndumpfilter__drop_empty_revs, svndumpfilter__drop_all_empty_revs,
svndumpfilter__renumber_revs,
svndumpfilter__skip_missing_merge_sources, svndumpfilter__targets,
svndumpfilter__preserve_revprops, svndumpfilter__quiet,
svndumpfilter__glob} },
- {"include", subcommand_include, {0},
- N_("Filter out nodes without given prefixes from dumpstream.\n"
- "usage: svndumpfilter include PATH_PREFIX...\n"),
+ {"include", subcommand_include, {0}, {N_(
+ "Filter out nodes without given prefixes from dumpstream.\n"
+ "usage: svndumpfilter include PATH_PREFIX...\n"
+ )},
{svndumpfilter__drop_empty_revs, svndumpfilter__drop_all_empty_revs,
svndumpfilter__renumber_revs,
svndumpfilter__skip_missing_merge_sources, svndumpfilter__targets,
svndumpfilter__preserve_revprops, svndumpfilter__quiet,
svndumpfilter__glob} },
- {"help", subcommand_help, {"?", "h"},
- N_("Describe the usage of this program or its subcommands.\n"
- "usage: svndumpfilter help [SUBCOMMAND...]\n"),
+ {"help", subcommand_help, {"?", "h"}, {N_(
+ "Describe the usage of this program or its subcommands.\n"
+ "usage: svndumpfilter help [SUBCOMMAND...]\n"
+ )},
{0} },
- { NULL, NULL, {0}, NULL, {0} }
+ { NULL, NULL, {0}, {NULL}, {0} }
};
@@ -1080,7 +1084,7 @@ subcommand_help(apr_getopt_t *os, void *baton, apr_pool_t *pool)
"\n"
"Available subcommands:\n");
- SVN_ERR(svn_opt_print_help4(os, "svndumpfilter",
+ SVN_ERR(svn_opt_print_help5(os, "svndumpfilter",
opt_state ? opt_state->version : FALSE,
opt_state ? opt_state->quiet : FALSE,
/*###opt_state ? opt_state->verbose :*/ FALSE,
@@ -1292,7 +1296,7 @@ sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
svn_error_t *err;
apr_status_t apr_err;
- const svn_opt_subcommand_desc2_t *subcommand = NULL;
+ const svn_opt_subcommand_desc3_t *subcommand = NULL;
struct svndumpfilter_opt_state opt_state;
apr_getopt_t *os;
int opt_id;
@@ -1399,7 +1403,7 @@ sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
just typos/mistakes. Whatever the case, the subcommand to
actually run is subcommand_help(). */
if (opt_state.help)
- subcommand = svn_opt_get_canonical_subcommand2(cmd_table, "help");
+ subcommand = svn_opt_get_canonical_subcommand3(cmd_table, "help");
/* If we're not running the `help' subcommand, then look for a
subcommand in the first argument. */
@@ -1410,8 +1414,8 @@ sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
if (opt_state.version)
{
/* Use the "help" subcommand to handle the "--version" option. */
- static const svn_opt_subcommand_desc2_t pseudo_cmd =
- { "--version", subcommand_help, {0}, "",
+ static const svn_opt_subcommand_desc3_t pseudo_cmd =
+ { "--version", subcommand_help, {0}, {""},
{svndumpfilter__version, /* must accept its own option */
svndumpfilter__quiet,
} };
@@ -1434,7 +1438,7 @@ sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
SVN_ERR(svn_utf_cstring_to_utf8(&first_arg, os->argv[os->ind++],
pool));
- subcommand = svn_opt_get_canonical_subcommand2(cmd_table, first_arg);
+ subcommand = svn_opt_get_canonical_subcommand3(cmd_table, first_arg);
if (subcommand == NULL)
{
svn_error_clear(
@@ -1464,7 +1468,7 @@ sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
/* Ensure that each prefix is UTF8-encoded, in internal
style, and absolute. */
SVN_ERR(svn_utf_cstring_to_utf8(&prefix, os->argv[i], pool));
- prefix = svn_relpath__internal_style(prefix, pool);
+ SVN_ERR(svn_relpath__make_internal(&prefix, prefix, pool, pool));
if (prefix[0] != '/')
prefix = apr_pstrcat(pool, "/", prefix, SVN_VA_NULL);
APR_ARRAY_PUSH(opt_state.prefixes, const char *) = prefix;
@@ -1520,11 +1524,11 @@ sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
if (opt_id == 'h' || opt_id == '?')
continue;
- if (! svn_opt_subcommand_takes_option3(subcommand, opt_id, NULL))
+ if (! svn_opt_subcommand_takes_option4(subcommand, opt_id, NULL))
{
const char *optstr;
const apr_getopt_option_t *badopt =
- svn_opt_get_option_from_code2(opt_id, options_table, subcommand,
+ svn_opt_get_option_from_code3(opt_id, options_table, subcommand,
pool);
svn_opt_format_option(&optstr, badopt, FALSE, pool);
if (subcommand->name[0] == '-')