Author: stefan2
Date: Tue Jun 30 17:59:22 2015
New Revision: 1688493
URL: http://svn.apache.org/r1688493
Log:
On the svn-mergeinfo-normalizer branch:
Make all 3 normalization options available to the "normalize" sub-command.
* tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c
(svn_min__longopt_t): Declare one CL option per normalization option.
(svn_min__options): Describe the new options.
(svn_min__cmd_table): Make them available with the "normalize" sub-command.
(sub_main): Process new options.
* tools/client-side/svn-mergeinfo-normalizer/normalize-cmd.c
(svn_min__normalize): If no option has been specified, default to sub-node
mergeinfo removal.
Modified:
subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/normalize-cmd.c
subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c
Modified:
subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/normalize-cmd.c
URL:
http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/normalize-cmd.c?rev=1688493&r1=1688492&r2=1688493&view=diff
==============================================================================
---
subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/normalize-cmd.c
(original)
+++
subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/normalize-cmd.c
Tue Jun 30 17:59:22 2015
@@ -39,7 +39,13 @@ svn_min__normalize(apr_getopt_t *os,
apr_pool_t *pool)
{
svn_min__cmd_baton_t *cmd_baton = baton;
- cmd_baton->opt_state->remove_redundants = TRUE;
+
+ /* If no option is given, default to "remove redundant sub-node m/i". */
+ if ( !cmd_baton->opt_state->remove_redundants
+ && !cmd_baton->opt_state->remove_obsoletes
+ && !cmd_baton->opt_state->combine_ranges)
+ cmd_baton->opt_state->remove_redundants = TRUE;
+
SVN_ERR(svn_min__run_command(os, baton, NULL, pool));
return SVN_NO_ERROR;
Modified:
subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c
URL:
http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c?rev=1688493&r1=1688492&r2=1688493&view=diff
==============================================================================
---
subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c
(original)
+++
subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c
Tue Jun 30 17:59:22 2015
@@ -85,6 +85,9 @@ typedef enum svn_min__longopt_t {
opt_trust_server_cert_not_yet_valid,
opt_trust_server_cert_other_failure,
opt_allow_mixed_revisions,
+ opt_remove_obsoletes,
+ opt_remove_redundant,
+ opt_combine_ranges,
} svn_cl__longopt_t;
@@ -163,6 +166,17 @@ const apr_getopt_option_t svn_min__optio
" "
"Please run 'svn update' instead.")},
+ {"remove-obsoletes", opt_remove_obsoletes, 0,
+ N_("Remove mergeinfo for deleted branches.")},
+ {"remove-redundant", opt_remove_redundant, 0,
+ N_("Remove mergeinfo on sub-nodes if it is\n"
+ " "
+ "redundant with the parent mergeinfo.")},
+ {"combine-ranges", opt_combine_ranges, 0,
+ N_("Try to combine adjacent revision ranges\n"
+ " "
+ "to reduce the size of the mergeinfo.")},
+
{0, 0, 0, 0},
};
@@ -213,7 +227,8 @@ const svn_opt_subcommand_desc2_t svn_min
{ "normalize", svn_min__normalize, { 0 }, N_
("Normalize the mergeinfo throughout the working copy sub-tree.\n"
"usage: normalize [WCPATH...]\n"),
- {opt_targets, opt_depth, opt_dry_run, 'q'} },
+ {opt_targets, opt_depth, opt_dry_run, 'q',
+ opt_remove_obsoletes, opt_remove_redundant, opt_combine_ranges} },
{ "clear-obsoletes", svn_min__clear_obsolete, { 0 }, N_
("Remove mergeinfo that refers to branches that no longer exist.\n"
@@ -449,6 +464,17 @@ sub_main(int *exit_code, int argc, const
case opt_allow_mixed_revisions:
opt_state.allow_mixed_rev = TRUE;
break;
+
+ case opt_remove_obsoletes:
+ opt_state.remove_obsoletes = TRUE;
+ break;
+ case opt_remove_redundant:
+ opt_state.remove_redundants = TRUE;
+ break;
+ case opt_combine_ranges:
+ opt_state.combine_ranges = TRUE;
+ break;
+
default:
/* Hmmm. Perhaps this would be a good place to squirrel away
opts that commands like svn diff might need. Hmmm indeed. */