You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2022/01/14 14:01:51 UTC
svn commit: r1897034 [27/37] - in /subversion/branches/multi-wc-format: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ contrib/client-side/ contrib/client-side/svn_load_dirs/ contrib/hook-scripts/ contrib/s...
Modified: subversion/branches/multi-wc-format/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svn/svn.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svn/svn.c (original)
+++ subversion/branches/multi-wc-format/subversion/svn/svn.c Fri Jan 14 14:01:45 2022
@@ -52,6 +52,8 @@
#include "svn_hash.h"
#include "svn_version.h"
#include "cl.h"
+#include "shelf2-cmd.h"
+#include "shelf-cmd.h"
#include "private/svn_opt_private.h"
#include "private/svn_cmdline_private.h"
@@ -63,95 +65,6 @@
/*** Option Processing ***/
-/* Add an identifier here for long options that don't have a short
- option. Options that have both long and short options should just
- use the short option letter as identifier. */
-typedef enum svn_cl__longopt_t {
- opt_auth_password = SVN_OPT_FIRST_LONGOPT_ID,
- opt_auth_password_from_stdin,
- opt_auth_username,
- opt_autoprops,
- opt_changelist,
- opt_config_dir,
- opt_config_options,
- /* diff options */
- opt_diff_cmd,
- opt_internal_diff,
- opt_no_diff_added,
- opt_no_diff_deleted,
- opt_show_copies_as_adds,
- opt_notice_ancestry,
- opt_summarize,
- opt_use_git_diff_format,
- opt_ignore_properties,
- opt_properties_only,
- opt_patch_compatible,
- /* end of diff options */
- opt_dry_run,
- opt_editor_cmd,
- opt_encoding,
- opt_force_log,
- opt_force,
- opt_keep_changelists,
- opt_ignore_ancestry,
- opt_ignore_externals,
- opt_incremental,
- opt_merge_cmd,
- opt_native_eol,
- opt_new_cmd,
- opt_no_auth_cache,
- opt_no_autoprops,
- opt_no_ignore,
- opt_no_unlock,
- opt_non_interactive,
- opt_force_interactive,
- opt_old_cmd,
- opt_record_only,
- opt_relocate,
- opt_remove,
- opt_revprop,
- opt_stop_on_copy,
- opt_strict, /* ### DEPRECATED */
- opt_targets,
- opt_depth,
- opt_set_depth,
- opt_version,
- opt_xml,
- opt_keep_local,
- opt_with_revprop,
- opt_with_all_revprops,
- opt_with_no_revprops,
- opt_parents,
- opt_accept,
- opt_show_revs,
- opt_reintegrate,
- opt_trust_server_cert,
- opt_trust_server_cert_failures,
- opt_strip,
- opt_ignore_keywords,
- opt_reverse_diff,
- opt_ignore_whitespace,
- opt_diff,
- opt_allow_mixed_revisions,
- opt_include_externals,
- opt_show_inherited_props,
- opt_search,
- opt_search_and,
- opt_mergeinfo_log,
- opt_remove_unversioned,
- opt_remove_ignored,
- opt_no_newline,
- opt_show_passwords,
- opt_pin_externals,
- opt_show_item,
- opt_adds_as_modification,
- opt_vacuum_pristines,
- opt_drop,
- opt_viewspec,
- opt_compatible_version
-} svn_cl__longopt_t;
-
-
/* Option codes and descriptions for the command line client.
*
* The entire list must be terminated with an entry of nulls.
@@ -167,6 +80,7 @@ const apr_getopt_option_t svn_cl__option
{"quiet", 'q', 0, N_("print nothing, or only summary information")},
{"recursive", 'R', 0, N_("descend recursively, same as --depth=infinity")},
{"non-recursive", 'N', 0, N_("obsolete")},
+ {"human-readable",'H', 0, N_("show human-readable output")},
{"change", 'c', 1,
N_("the change made by revision ARG (like -r ARG-1:ARG)\n"
" "
@@ -421,6 +335,8 @@ const apr_getopt_option_t svn_cl__option
{"remove-unversioned", opt_remove_unversioned, 0,
N_("remove unversioned items")},
{"remove-ignored", opt_remove_ignored, 0, N_("remove ignored items")},
+ {"remove-added", opt_remove_added, 0,
+ N_("reverting an added item will remove it from disk")},
{"no-newline", opt_no_newline, 0, N_("do not output the trailing newline")},
{"show-passwords", opt_show_passwords, 0, N_("show cached passwords")},
{"pin-externals", opt_pin_externals, 0,
@@ -457,7 +373,7 @@ const apr_getopt_option_t svn_cl__option
/* Long-opt Aliases
*
- * These have NULL desriptions, but an option code that matches some
+ * These have NULL descriptions, but an option code that matches some
* other option (whose description should probably mention its aliases).
*/
@@ -492,15 +408,8 @@ const int svn_cl__global_options[] =
opt_config_dir, opt_config_options, 0
};
-/* Options for giving a log message. (Some of these also have other uses.)
- */
-#define SVN_CL__LOG_MSG_OPTIONS 'm', 'F', \
- opt_force_log, \
- opt_editor_cmd, \
- opt_encoding, \
- opt_with_revprop
-
-const svn_opt_subcommand_desc3_t svn_cl__cmd_table[] =
+static const svn_opt_subcommand_desc3_t
+svn_cl__cmd_table_main[] =
{
{ "add", svn_cl__add, {0}, {N_(
"Put new files and directories under version control.\n"
@@ -594,7 +503,8 @@ const svn_opt_subcommand_desc3_t svn_cl_
{'r', opt_ignore_keywords} },
{ "changelist", svn_cl__changelist, {"cl"}, {N_(
- "Associate (or dissociate) changelist CLNAME with the named files.\n"
+ "Associate (or dissociate) changelist CLNAME with the named\n"
+ "files.\n"
"usage: 1. changelist CLNAME PATH...\n"
" 2. changelist --remove PATH...\n"
)},
@@ -631,8 +541,8 @@ const svn_opt_subcommand_desc3_t svn_cl_
{{'N', N_("obsolete; same as --depth=files")}} },
{ "cleanup", svn_cl__cleanup, {0}, {N_(
- "Either recover from an interrupted operation that left the working copy locked,\n"
- "or remove unwanted files.\n"
+ "Either recover from an interrupted operation that left the working\n"
+ "copy locked, or remove unwanted files.\n"
"usage: 1. cleanup [WCPATH...]\n"
" 2. cleanup --remove-unversioned [WCPATH...]\n"
" cleanup --remove-ignored [WCPATH...]\n"
@@ -659,9 +569,9 @@ const svn_opt_subcommand_desc3_t svn_cl_
" referenced by any file in the working copy.\n"
)},
{ opt_remove_unversioned, opt_remove_ignored, opt_vacuum_pristines,
- opt_include_externals, 'q', opt_merge_cmd },
+ opt_include_externals, 'q', opt_merge_cmd },
{ { opt_merge_cmd, N_("deprecated and ignored") } } },
-
+
{ "commit", svn_cl__commit, {"ci"}, {N_(
"Send changes from your working copy to the repository.\n"
"usage: commit [PATH...]\n"
@@ -791,7 +701,8 @@ const svn_opt_subcommand_desc3_t svn_cl_
"Describe the usage of this program or its subcommands.\n"
"usage: help [SUBCOMMAND...]\n"
)},
- {0} },
+ {'v'},
+ {{'v', N_("also show experimental subcommands and options")}} },
/* This command is also invoked if we see option "--help", "-h" or "-?". */
{ "import", svn_cl__import, {0}, {N_(
@@ -825,10 +736,17 @@ const svn_opt_subcommand_desc3_t svn_cl_
" EXPERIMENTAL:\n"
" With --x-viewspec, print the working copy layout.\n"
)},
- {'r', 'R', opt_depth, opt_targets, opt_incremental, opt_xml,
+ {'r', 'R', 'H', opt_depth, opt_targets, opt_incremental, opt_xml,
opt_changelist, opt_include_externals, opt_show_item, opt_no_newline,
opt_viewspec},
- {{opt_show_item, N_("print only the item identified by ARG:\n"
+ {{'H', N_("show file sizes with base-2 unit suffixes\n"
+ " "
+ "(Byte, Kilobyte, Megabyte, Gigabyte, Terabyte\n"
+ " "
+ "and Petabyte), limiting the number of digits\n"
+ " "
+ "to three or less")},
+ {opt_show_item, N_("print only the item identified by ARG:\n"
" "
" 'kind' node kind of TARGET\n"
" "
@@ -844,6 +762,10 @@ const svn_opt_subcommand_desc3_t svn_cl_
" "
" 'repos-uuid' UUID of repository\n"
" "
+ " 'repos-size' for files, the size of TARGET\n"
+ " "
+ " in the repository\n"
+ " "
" 'revision' specified or implied revision\n"
" "
" 'last-changed-revision'\n"
@@ -870,11 +792,12 @@ const svn_opt_subcommand_desc3_t svn_cl_
" "
" 'wc-format-min' oldest supported WC format\n"
" "
- " 'wc-format-min' newest supported WC format\n")}},
+ " 'wc-format-min' newest supported WC format\n"
+ " "
+ " 'changelist' changelist of TARGET in WC")}},
},
{ "list", svn_cl__list, {"ls"},
-#if defined(WIN32)
{N_(
"List directory entries in the repository.\n"
"usage: list [TARGET[@REV]...]\n"
@@ -886,37 +809,22 @@ const svn_opt_subcommand_desc3_t svn_cl_
"\n"), N_(
" The default TARGET is '.', meaning the repository URL of the current\n"
" working directory.\n"
- "\n"), N_(
+ "\n"),
+#if defined(WIN32)
+ N_(
" Multiple --search patterns may be specified and the output will be\n"
" reduced to those paths whose last segment - i.e. the file or directory\n"
" name - contains a sub-string matching at least one of these patterns\n"
" (Windows only).\n"
- "\n"), N_(
- " With --verbose, the following fields will be shown for each item:\n"
- "\n"), N_(
- " Revision number of the last commit\n"
- " Author of the last commit\n"
- " If locked, the letter 'O'. (Use 'svn info URL' to see details)\n"
- " Size (in bytes)\n"
- " Date and time of the last commit\n"
- )},
+ "\n"),
#else
- {N_(
- "List directory entries in the repository.\n"
- "usage: list [TARGET[@REV]...]\n"
- "\n"), N_(
- " List each TARGET file and the contents of each TARGET directory as\n"
- " they exist in the repository. If TARGET is a working copy path, the\n"
- " corresponding repository URL will be used. If specified, REV determines\n"
- " in which revision the target is first looked up.\n"
- "\n"), N_(
- " The default TARGET is '.', meaning the repository URL of the current\n"
- " working directory.\n"
- "\n"), N_(
+ N_(
" Multiple --search patterns may be specified and the output will be\n"
" reduced to those paths whose last segment - i.e. the file or directory\n"
" name - matches at least one of these patterns.\n"
- "\n"), N_(
+ "\n"),
+#endif
+ N_(
" With --verbose, the following fields will be shown for each item:\n"
"\n"), N_(
" Revision number of the last commit\n"
@@ -925,9 +833,15 @@ const svn_opt_subcommand_desc3_t svn_cl_
" Size (in bytes)\n"
" Date and time of the last commit\n"
)},
-#endif
- {'r', 'v', 'R', opt_depth, opt_incremental, opt_xml,
- opt_include_externals, opt_search}, },
+ {'r', 'v', 'R', 'H', opt_depth, opt_incremental, opt_xml,
+ opt_include_externals, opt_search},
+ {{'H', N_("with --verbose, show file sizes with base-2\n"
+ " "
+ "unit suffixes (Byte, Kilobyte, Megabyte,\n"
+ " "
+ "Gigabyte, Terabyte and Petabyte), limiting\n"
+ " "
+ "the number of digits to three or less")}} },
{ "lock", svn_cl__lock, {0}, {N_(
"Lock working copy paths or URLs in the repository, so that\n"
@@ -1777,7 +1691,8 @@ const svn_opt_subcommand_desc3_t svn_cl_
" For information about undoing already committed changes, search\n"
" the output of 'svn help merge' for 'undo'.\n"
)},
- {opt_targets, 'R', opt_depth, 'q', opt_changelist} },
+ {opt_targets, 'R', opt_depth, 'q', opt_changelist,
+ opt_remove_added} },
{ "status", svn_cl__status, {"stat", "st"}, {N_(
"Print the status of working copy files and directories.\n"
@@ -1878,7 +1793,8 @@ const svn_opt_subcommand_desc3_t svn_cl_
{'N', N_("obsolete; same as --depth=immediates")}} },
{ "switch", svn_cl__switch, {"sw"}, {N_(
- "Update the working copy to a different URL within the same repository.\n"
+ "Update the working copy to a different URL within the same\n"
+ "repository.\n"
"usage: 1. switch URL[@PEGREV] [PATH]\n"
" 2. switch --relocate FROM-PREFIX TO-PREFIX [PATH...]\n"
"\n"), N_(
@@ -1914,9 +1830,6 @@ const svn_opt_subcommand_desc3_t svn_cl_
"\n"), N_(
" Examples:\n"
" svn switch ^/branches/1.x-release\n"
- " svn switch --relocate http:// svn://\n"
- " svn switch --relocate http://www.example.com/repo/project \\\n"
- " svn://svn.example.com/repo/project\n"
)},
{ 'r', 'N', opt_depth, opt_set_depth, 'q', opt_merge_cmd,
opt_ignore_externals, opt_ignore_ancestry, opt_force, opt_accept,
@@ -2000,155 +1913,11 @@ const svn_opt_subcommand_desc3_t svn_cl_
)},
{ 'q', opt_compatible_version } },
- { "x-shelf-diff", svn_cl__shelf_diff, {0}, {N_(
- "Show shelved changes as a diff.\n"
- "usage: x-shelf-diff SHELF [VERSION]\n"
- "\n"), N_(
- " Show the changes in SHELF:VERSION (default: latest) as a diff.\n"
- "\n"), N_(
- " See also: 'svn diff --cl=svn:shelf:SHELF' which supports most options of\n"
- " 'svn diff'.\n"
- "\n"), N_(
- " The shelving feature is EXPERIMENTAL. This command is likely to change\n"
- " in the next release, and there is no promise of backward compatibility.\n"
- )},
- {opt_summarize},
- },
-
- { "x-shelf-drop", svn_cl__shelf_drop, {0}, {N_(
- "Delete a shelf.\n"
- "usage: x-shelf-drop SHELF [PATH ...]\n"
- "\n"), N_(
- " Delete the shelves named SHELF from the working copies containing PATH\n"
- " (default PATH is '.')\n"
- "\n"), N_(
- " The shelving feature is EXPERIMENTAL. This command is likely to change\n"
- " in the next release, and there is no promise of backward compatibility.\n"
- )},
- },
-
- { "x-shelf-list", svn_cl__shelf_list, {"x-shelves"}, {N_(
- "List shelves.\n"
- "usage: x-shelf-list [PATH ...]\n"
- "\n"), N_(
- " List shelves for each working copy containing PATH (default is '.')\n"
- " Include the first line of any log message and some details about the\n"
- " contents of the shelf, unless '-q' is given.\n"
- "\n"), N_(
- " The shelving feature is EXPERIMENTAL. This command is likely to change\n"
- " in the next release, and there is no promise of backward compatibility.\n"
- )},
- {'q', 'v'}
- },
-
- { "x-shelf-list-by-paths", svn_cl__shelf_list_by_paths, {0}, {N_(
- "List which shelf affects each path.\n"
- "usage: x-shelf-list-by-paths [PATH...]\n"
- "\n"), N_(
- " List which shelf most recently affects each path below the given PATHs.\n"
- "\n"), N_(
- " The shelving feature is EXPERIMENTAL. This command is likely to change\n"
- " in the next release, and there is no promise of backward compatibility.\n"
- )},
- },
-
- { "x-shelf-log", svn_cl__shelf_log, {0}, {N_(
- "Show the versions of a shelf.\n"
- "usage: x-shelf-log SHELF [PATH...]\n"
- "\n"), N_(
- " Show all versions of SHELF for each working copy containing PATH (the\n"
- " default PATH is '.').\n"
- "\n"), N_(
- " The shelving feature is EXPERIMENTAL. This command is likely to change\n"
- " in the next release, and there is no promise of backward compatibility.\n"
- )},
- {'q', 'v'}
- },
-
- { "x-shelf-save", svn_cl__shelf_save, {0}, {N_(
- "Copy local changes onto a new version of a shelf.\n"
- "usage: x-shelf-save SHELF [PATH...]\n"
- "\n"), N_(
- " Save local changes in the given PATHs as a new version of SHELF.\n"
- " The shelf's log message can be set with -m, -F, etc.\n"
- "\n"), N_(
- " The same as 'svn shelve --keep-local'.\n"
- "\n"), N_(
- " The shelving feature is EXPERIMENTAL. This command is likely to change\n"
- " in the next release, and there is no promise of backward compatibility.\n"
- )},
- {'q', opt_dry_run,
- opt_depth, opt_targets, opt_changelist,
- SVN_CL__LOG_MSG_OPTIONS,
- }
- },
-
- { "x-shelve", svn_cl__shelf_shelve, {0}, {N_(
- "Move local changes onto a shelf.\n"
- "usage: x-shelve [--keep-local] SHELF [PATH...]\n"
- "\n"), N_(
- " Save the local changes in the given PATHs to a new or existing SHELF.\n"
- " Revert those changes from the WC unless '--keep-local' is given.\n"
- " The shelf's log message can be set with -m, -F, etc.\n"
- "\n"), N_(
- " 'svn shelve --keep-local' is the same as 'svn shelf-save'.\n"
- "\n"), N_(
- " The kinds of change you can shelve are committable changes to files and\n"
- " properties, except the following kinds which are not yet supported:\n"
- " * copies and moves\n"
- " * mkdir and rmdir\n"
- " Uncommittable states such as conflicts, unversioned and missing cannot\n"
- " be shelved.\n"
- "\n"), N_(
- " To bring back shelved changes, use 'svn unshelve SHELF'.\n"
- "\n"), N_(
- " Shelves are currently stored under <WC>/.svn/experimental/shelves/ .\n"
- " (In Subversion 1.10, shelves were stored under <WC>/.svn/shelves/ as\n"
- " patch files. To recover a shelf created by 1.10, either use a 1.10\n"
- " client to find and unshelve it, or find the patch file and use any\n"
- " 1.10 or later 'svn patch' to apply it.)\n"
- "\n"), N_(
- " The shelving feature is EXPERIMENTAL. This command is likely to change\n"
- " in the next release, and there is no promise of backward compatibility.\n"
- )},
- {'q', opt_dry_run, opt_keep_local,
- opt_depth, opt_targets, opt_changelist,
- SVN_CL__LOG_MSG_OPTIONS,
- } },
-
- { "x-unshelve", svn_cl__shelf_unshelve, {0}, {N_(
- "Copy shelved changes back into the WC.\n"
- "usage: x-unshelve [--drop] [SHELF [VERSION]]\n"
- "\n"), N_(
- " Apply the changes stored in SHELF to the working copy.\n"
- " SHELF defaults to the newest shelf.\n"
- "\n"), N_(
- " Apply the newest version of the shelf, by default. If VERSION is\n"
- " specified, apply that version and discard all versions newer than that.\n"
- " In any case, retain the unshelved version and versions older than that\n"
- " (unless --drop is specified).\n"
- "\n"), N_(
- " With --drop, delete the entire shelf (like 'svn shelf-drop') after\n"
- " successfully unshelving with no conflicts.\n"
- "\n"), N_(
- " The working files involved should be in a clean, unmodified state\n"
- " before using this command. To roll back to an older version of the\n"
- " shelf, first ensure any current working changes are removed, such as\n"
- " by shelving or reverting them, and then unshelve the desired version.\n"
- "\n"), N_(
- " Unshelve normally refuses to apply any changes if any path involved is\n"
- " already modified (or has any other abnormal status) in the WC. With\n"
- " --force, it does not check and may error out and/or produce partial or\n"
- " unexpected results.\n"
- "\n"), N_(
- " The shelving feature is EXPERIMENTAL. This command is likely to change\n"
- " in the next release, and there is no promise of backward compatibility.\n"
- )},
- {opt_drop, 'q', opt_dry_run, opt_force} },
-
{ NULL, NULL, {0}, {NULL}, {0} }
};
+const svn_opt_subcommand_desc3_t *svn_cl__cmd_table = svn_cl__cmd_table_main;
+
/* Version compatibility check */
static svn_error_t *
@@ -2169,7 +1938,7 @@ check_lib_versions(void)
return svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
}
-/* The cancelation handler setup by the cmdline library. */
+/* The cancellation handler setup by the cmdline library. */
svn_cancel_func_t svn_cl__check_cancel = NULL;
/* Add a --search argument to OPT_STATE.
@@ -2227,6 +1996,33 @@ viewspec_from_word(enum svn_cl__viewspec
return SVN_NO_ERROR;
}
+/* Re-initialize the command table SVN_CL__CMD_TABLE,
+ * adding additional commands from CMDS_ADD.
+ * (TODO: and the options table) */
+static void
+add_commands(const svn_opt_subcommand_desc3_t *cmds_add,
+ apr_pool_t *pool)
+{
+ int elt_size = sizeof(svn_opt_subcommand_desc3_t);
+ const svn_opt_subcommand_desc3_t *cmds_old = svn_cl__cmd_table;
+ const svn_opt_subcommand_desc3_t *cmd;
+ int n_cmds_old, n_cmds_add, n_cmds_new;
+ svn_opt_subcommand_desc3_t *cmds_new;
+
+ for (cmd = cmds_old; cmd->name; cmd++) ;
+ n_cmds_old = (int)(cmd - cmds_old);
+ for (cmd = cmds_add; cmd->name; cmd++) ;
+ n_cmds_add = (int)(cmd - cmds_add);
+ n_cmds_new = n_cmds_old + n_cmds_add;
+
+ /* copy CMDS_OLD and CMDS_ADD, plus an all-zeros terminator entry */
+ cmds_new = apr_pcalloc(pool, (n_cmds_new + 1) * elt_size);
+ memcpy(cmds_new, cmds_old, n_cmds_old * elt_size);
+ memcpy(&cmds_new[n_cmds_old], cmds_add, n_cmds_add * elt_size);
+
+ svn_cl__cmd_table = cmds_new;
+}
+
static svn_error_t *
parse_compatible_version(svn_cl__opt_state_t* opt_state,
const char *opt_arg,
@@ -2322,6 +2118,7 @@ sub_main(int *exit_code, int argc, const
svn_cl__opt_state_t opt_state = { 0, { 0 } };
svn_client_ctx_t *ctx;
apr_array_header_t *received_opts;
+ const char *exp_cmds;
int i;
const svn_opt_subcommand_desc3_t *subcommand = NULL;
const char *dash_F_arg = NULL;
@@ -2362,6 +2159,18 @@ sub_main(int *exit_code, int argc, const
/* Init the temporary buffer. */
svn_membuf__create(&buf, 0, pool);
+ /* Add experimental commands, if requested. Use the most recent version
+ * that we know about and that is mentioned in the env. var. */
+ exp_cmds = getenv("SVN_EXPERIMENTAL_COMMANDS");
+ if (exp_cmds && strstr(exp_cmds, "shelf3"))
+ {
+ add_commands(svn_cl__cmd_table_shelf3, pool);
+ }
+ else if (exp_cmds && strstr(exp_cmds, "shelf2"))
+ {
+ add_commands(svn_cl__cmd_table_shelf2, pool);
+ }
+
/* Begin processing arguments. */
opt_state.start_revision.kind = svn_opt_revision_unspecified;
opt_state.end_revision.kind = svn_opt_revision_unspecified;
@@ -2371,6 +2180,7 @@ sub_main(int *exit_code, int argc, const
opt_state.set_depth = svn_depth_unknown;
opt_state.accept_which = svn_cl__accept_unspecified;
opt_state.show_revs = svn_cl__show_revs_invalid;
+ opt_state.file_size_unit = SVN_CL__SIZE_UNIT_NONE;
/* No args? Show usage. */
if (argc <= 1)
@@ -2586,6 +2396,9 @@ sub_main(int *exit_code, int argc, const
case 'N':
descend = FALSE;
break;
+ case 'H':
+ opt_state.file_size_unit = SVN_CL__SIZE_UNIT_BASE_2;
+ break;
case opt_depth:
err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
if (err)
@@ -2723,7 +2536,8 @@ sub_main(int *exit_code, int argc, const
break;
case opt_config_dir:
SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
- opt_state.config_dir = svn_dirent_internal_style(utf8_opt_arg, pool);
+ SVN_ERR(svn_dirent_internal_style_safe(&opt_state.config_dir, NULL,
+ utf8_opt_arg, pool, pool));
break;
case opt_config_options:
if (!opt_state.config_options)
@@ -2892,6 +2706,9 @@ sub_main(int *exit_code, int argc, const
case opt_remove_ignored:
opt_state.remove_ignored = TRUE;
break;
+ case opt_remove_added:
+ opt_state.remove_added = TRUE;
+ break;
case opt_no_newline:
case opt_strict: /* ### DEPRECATED */
opt_state.no_newline = TRUE;
@@ -3291,17 +3108,7 @@ sub_main(int *exit_code, int argc, const
sense (unless we've also been instructed not to care). This may
access the working copy so do it after setting the locking mode. */
if ((! opt_state.force_log)
- && (subcommand->cmd_func == svn_cl__commit
- || subcommand->cmd_func == svn_cl__copy
- || subcommand->cmd_func == svn_cl__delete
- || subcommand->cmd_func == svn_cl__import
- || subcommand->cmd_func == svn_cl__mkdir
- || subcommand->cmd_func == svn_cl__move
- || subcommand->cmd_func == svn_cl__lock
- || subcommand->cmd_func == svn_cl__propedit
- || subcommand->cmd_func == svn_cl__shelf_save
- || subcommand->cmd_func == svn_cl__shelf_shelve
- ))
+ && subcommand->cmd_func != svn_cl__propset)
{
/* If the -F argument is a file that's under revision control,
that's probably not what the user intended. */
@@ -3309,7 +3116,10 @@ sub_main(int *exit_code, int argc, const
{
svn_node_kind_t kind;
const char *local_abspath;
- const char *fname = svn_dirent_internal_style(dash_F_arg, pool);
+ const char *fname;
+
+ SVN_ERR(svn_dirent_internal_style_safe(&fname, NULL, dash_F_arg,
+ pool, pool));
err = svn_dirent_get_absolute(&local_abspath, fname, pool);
Modified: subversion/branches/multi-wc-format/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svn/util.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svn/util.c (original)
+++ subversion/branches/multi-wc-format/subversion/svn/util.c Fri Jan 14 14:01:45 2022
@@ -163,6 +163,8 @@ svn_cl__merge_file_externally(const char
arguments[5] = wc_path;
arguments[6] = NULL;
+ /* Presumably apr_filepath_get() returns a valid path, so we don't have
+ to use the safe version of svn_dirent_internal_style() here. */
SVN_ERR(svn_io_run_cmd(svn_dirent_internal_style(cwd, pool), merge_tool,
arguments, &exitcode, NULL, TRUE, NULL, NULL, NULL,
pool));
Modified: subversion/branches/multi-wc-format/subversion/svn_private_config.hw
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svn_private_config.hw?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svn_private_config.hw (original)
+++ subversion/branches/multi-wc-format/subversion/svn_private_config.hw Fri Jan 14 14:01:45 2022
@@ -39,6 +39,10 @@
#define SVN_BUILD_TARGET "ia64-microsoft-windows"
#elif defined( _M_IX86)
#define SVN_BUILD_TARGET "x86-microsoft-windows"
+#elif defined(_M_ARM64)
+#define SVN_BUILD_TARGET "arm64-microsoft-windows"
+#elif defined(_M_ARM)
+#define SVN_BUILD_TARGET "arm-microsoft-windows"
#else
#error Unsupported build target.
#endif
@@ -119,7 +123,7 @@
#define SVN__PREDICT_FALSE(x) (x)
/* Macro used to specify that a variable is intentionally left unused.
- Supresses compiler warnings about the variable being unused. */
+ Suppresses compiler warnings about the variable being unused. */
#define SVN_UNUSED(v) ( (void)(v) )
#if defined(_MSC_VER) && _MSC_VER >= 1600
Modified: subversion/branches/multi-wc-format/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svnadmin/svnadmin.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svnadmin/svnadmin.c (original)
+++ subversion/branches/multi-wc-format/subversion/svnadmin/svnadmin.c Fri Jan 14 14:01:45 2022
@@ -42,6 +42,7 @@
#include "svn_time.h"
#include "svn_user.h"
#include "svn_xml.h"
+#include "svn_fs.h"
#include "private/svn_cmdline_private.h"
#include "private/svn_opt_private.h"
@@ -49,6 +50,7 @@
#include "private/svn_subr_private.h"
#include "private/svn_cmdline_private.h"
#include "private/svn_fspath.h"
+#include "private/svn_fs_fs_private.h"
#include "svn_private_config.h"
@@ -95,6 +97,7 @@ check_lib_versions(void)
/** Subcommands. **/
static svn_opt_subcommand_t
+ subcommand_build_repcache,
subcommand_crashtest,
subcommand_create,
subcommand_delrevprop,
@@ -114,6 +117,7 @@ static svn_opt_subcommand_t
subcommand_lstxns,
subcommand_pack,
subcommand_recover,
+ subcommand_rev_size,
subcommand_rmlocks,
subcommand_rmtxns,
subcommand_setlog,
@@ -303,6 +307,16 @@ static const apr_getopt_option_t options
*/
static const svn_opt_subcommand_desc3_t cmd_table[] =
{
+ {"build-repcache", subcommand_build_repcache, {0}, {N_(
+ "usage: svnadmin build-repcache REPOS_PATH [-r LOWER[:UPPER]]\n"
+ "\n"), N_(
+ "Add missing entries to the representation cache for the repository\n"
+ "at REPOS_PATH. Process data in revisions LOWER through UPPER.\n"
+ "If no revision arguments are given, process all revisions. If only\n"
+ "LOWER revision argument is given, process only that single revision.\n"
+ )},
+ {'r', 'q', 'M'} },
+
{"crashtest", subcommand_crashtest, {0}, {N_(
"usage: svnadmin crashtest REPOS_PATH\n"
"\n"), N_(
@@ -338,7 +352,8 @@ static const svn_opt_subcommand_desc3_t
"2. Delete the property NAME on transaction TXN.\n"
)},
{'r', 't', svnadmin__use_pre_revprop_change_hook,
- svnadmin__use_post_revprop_change_hook} },
+ svnadmin__use_post_revprop_change_hook},
+ { {'r', "specify revision number ARG"} } },
{"deltify", subcommand_deltify, {0}, {N_(
"usage: svnadmin deltify [-r LOWER[:UPPER]] REPOS_PATH\n"
@@ -495,7 +510,7 @@ static const svn_opt_subcommand_desc3_t
"Print the names of uncommitted transactions. With -rN skip the output\n"
"of those that have a base revision more recent than rN. Transactions\n"
"with base revisions much older than HEAD are likely to have been\n"
- "abandonded and are candidates to be removed.\n"
+ "abandoned and are candidates to be removed.\n"
)},
{'r'},
{ {'r', "transaction base revision ARG"} } },
@@ -518,6 +533,18 @@ static const svn_opt_subcommand_desc3_t
)},
{svnadmin__wait} },
+ {"rev-size", subcommand_rev_size, {0}, {N_(
+ "usage: svnadmin rev-size REPOS_PATH -r REVISION\n"
+ "\n"), N_(
+ "Print the total size in bytes of the representation on disk of\n"
+ "revision REVISION.\n"
+ "\n"), N_(
+ "The size includes revision properties and excludes FSFS indexes.\n"
+ )},
+ {'r', 'q', 'M'},
+ { {'r', "specify revision number ARG"},
+ {'q', "print only the size and a newline"} }, },
+
{"rmlocks", subcommand_rmlocks, {0}, {N_(
"usage: svnadmin rmlocks REPOS_PATH LOCKED_PATH...\n"
"\n"), N_(
@@ -545,7 +572,8 @@ static const svn_opt_subcommand_desc3_t
"NOTE: Revision properties are not versioned, so this command will\n"
"overwrite the previous log message.\n"
)},
- {'r', svnadmin__bypass_hooks} },
+ {'r', svnadmin__bypass_hooks},
+ { {'r', "specify revision number ARG"} }, },
{"setrevprop", subcommand_setrevprop, {0}, {N_(
"usage: 1. svnadmin setrevprop REPOS_PATH -r REVISION NAME FILE\n"
@@ -563,7 +591,8 @@ static const svn_opt_subcommand_desc3_t
"2. Set the property NAME on transaction TXN to the contents of FILE.\n"
)},
{'r', 't', svnadmin__use_pre_revprop_change_hook,
- svnadmin__use_post_revprop_change_hook} },
+ svnadmin__use_post_revprop_change_hook},
+ { {'r', "specify revision number ARG"} }, },
{"setuuid", subcommand_setuuid, {0}, {N_(
"usage: svnadmin setuuid REPOS_PATH [NEW_UUID]\n"
@@ -1819,7 +1848,7 @@ subcommand_lstxns(apr_getopt_t *os, void
SVN_ERR(svn_fs_youngest_rev(&youngest, fs, pool));
SVN_ERR(get_revnum(&limit, &opt_state->start_revision, youngest, repos,
pool));
-
+
iterpool = svn_pool_create(pool);
for (i = 0; i < txns->nelts; i++)
{
@@ -2847,6 +2876,174 @@ subcommand_delrevprop(apr_getopt_t *os,
}
+/* Set *REV_SIZE to the total size in bytes of the representation on disk
+ * of revision REVISION in FS.
+ *
+ * This is implemented only for FSFS repositories, and otherwise returns
+ * an SVN_ERR_UNSUPPORTED_FEATURE error.
+ *
+ * The size includes revision properties and excludes FSFS indexes.
+ */
+static svn_error_t *
+revision_size(apr_off_t *rev_size,
+ svn_fs_t *fs,
+ svn_revnum_t revision,
+ apr_pool_t *scratch_pool)
+{
+ svn_error_t *err;
+ svn_fs_fs__ioctl_revision_size_input_t input = {0};
+ svn_fs_fs__ioctl_revision_size_output_t *output;
+
+ input.revision = revision;
+ err = svn_fs_ioctl(fs, SVN_FS_FS__IOCTL_REVISION_SIZE,
+ &input, (void **)&output,
+ check_cancel, NULL, scratch_pool, scratch_pool);
+ if (err && err->apr_err == SVN_ERR_FS_UNRECOGNIZED_IOCTL_CODE)
+ {
+ return svn_error_quick_wrapf(err,
+ _("Revision size query is not implemented "
+ "for the filesystem type found in '%s'"),
+ svn_fs_path(fs, scratch_pool));
+ }
+ SVN_ERR(err);
+
+ *rev_size = output->rev_size;
+ return SVN_NO_ERROR;
+}
+
+/* This implements `svn_opt_subcommand_t'. */
+svn_error_t *
+subcommand_rev_size(apr_getopt_t *os, void *baton, apr_pool_t *pool)
+{
+ struct svnadmin_opt_state *opt_state = baton;
+ svn_revnum_t revision;
+ apr_off_t rev_size;
+ svn_repos_t *repos;
+
+ if (opt_state->start_revision.kind != svn_opt_revision_number
+ || opt_state->end_revision.kind != svn_opt_revision_unspecified)
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("Invalid revision specifier"));
+ revision = opt_state->start_revision.value.number;
+
+ SVN_ERR(open_repos(&repos, opt_state->repository_path, opt_state, pool));
+ SVN_ERR(revision_size(&rev_size, svn_repos_fs(repos), revision, pool));
+
+ if (opt_state->quiet)
+ {
+ SVN_ERR(svn_cmdline_printf(pool, "%"APR_OFF_T_FMT"\n", rev_size));
+ }
+ else
+ {
+ const char *rev_size_str = apr_psprintf(pool,
+ "%12" APR_OFF_T_FMT, rev_size);
+ SVN_ERR(svn_cmdline_printf(pool, _("%s bytes in revision %ld\n"),
+ rev_size_str, revision));
+ }
+ return SVN_NO_ERROR;
+}
+
+static void
+build_rep_cache_progress_func(svn_revnum_t revision,
+ void *baton,
+ apr_pool_t *pool)
+{
+ svn_error_clear(svn_cmdline_printf(pool,
+ _("* Processed revision %ld.\n"),
+ revision));
+}
+
+static svn_error_t *
+build_rep_cache(svn_fs_t *fs,
+ svn_revnum_t start_rev,
+ svn_revnum_t end_rev,
+ struct svnadmin_opt_state *opt_state,
+ apr_pool_t *pool)
+{
+ svn_fs_fs__ioctl_build_rep_cache_input_t input = {0};
+ svn_error_t *err;
+
+ input.start_rev = start_rev;
+ input.end_rev = end_rev;
+
+ if (opt_state->quiet)
+ {
+ input.progress_func = NULL;
+ input.progress_baton = NULL;
+ }
+ else
+ {
+ input.progress_func = build_rep_cache_progress_func;
+ input.progress_baton = NULL;
+ }
+
+ err = svn_fs_ioctl(fs, SVN_FS_FS__IOCTL_BUILD_REP_CACHE,
+ &input, NULL,
+ check_cancel, NULL, pool, pool);
+ if (err && err->apr_err == SVN_ERR_FS_UNRECOGNIZED_IOCTL_CODE)
+ {
+ return svn_error_quick_wrapf(err,
+ _("Building rep-cache is not implemented "
+ "for the filesystem type found in '%s'"),
+ svn_fs_path(fs, pool));
+ }
+ else if (err && err->apr_err == SVN_ERR_FS_REP_SHARING_NOT_ALLOWED)
+ {
+ svn_error_clear(err);
+ SVN_ERR(svn_cmdline_printf(pool,
+ _("svnadmin: Warning - this repository has rep-sharing disabled."
+ " Building rep-cache has no effect.\n")));
+ return SVN_NO_ERROR;
+ }
+ else
+ {
+ return err;
+ }
+}
+
+/* This implements `svn_opt_subcommand_t'. */
+static svn_error_t *
+subcommand_build_repcache(apr_getopt_t *os, void *baton, apr_pool_t *pool)
+{
+ struct svnadmin_opt_state *opt_state = baton;
+ svn_repos_t *repos;
+ svn_fs_t *fs;
+ svn_revnum_t youngest;
+ svn_revnum_t lower;
+ svn_revnum_t upper;
+
+ /* Expect no more arguments. */
+ SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+
+ SVN_ERR(open_repos(&repos, opt_state->repository_path, opt_state, pool));
+ fs = svn_repos_fs(repos);
+ SVN_ERR(svn_fs_youngest_rev(&youngest, fs, pool));
+
+ SVN_ERR(get_revnum(&lower, &opt_state->start_revision,
+ youngest, repos, pool));
+ SVN_ERR(get_revnum(&upper, &opt_state->end_revision,
+ youngest, repos, pool));
+
+ if (SVN_IS_VALID_REVNUM(lower) && SVN_IS_VALID_REVNUM(upper))
+ {
+ if (lower > upper)
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("First revision cannot be higher than second"));
+ }
+ else if (SVN_IS_VALID_REVNUM(lower))
+ {
+ upper = lower;
+ }
+ else
+ {
+ upper = youngest;
+ }
+
+ SVN_ERR(build_rep_cache(fs, lower, upper, opt_state, pool));
+
+ return SVN_NO_ERROR;
+}
+
/** Main. **/
Modified: subversion/branches/multi-wc-format/subversion/svnbench/null-blame-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svnbench/null-blame-cmd.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svnbench/null-blame-cmd.c (original)
+++ subversion/branches/multi-wc-format/subversion/svnbench/null-blame-cmd.c Fri Jan 14 14:01:45 2022
@@ -58,7 +58,7 @@ delta_handler(svn_txdelta_window_t *wind
return SVN_NO_ERROR;
}
-/* Implementes svn_file_rev_handler_t */
+/* Implements svn_file_rev_handler_t */
static svn_error_t *
file_rev_handler(void *baton, const char *path, svn_revnum_t revnum,
apr_hash_t *rev_props,
Modified: subversion/branches/multi-wc-format/subversion/svnbench/svnbench.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svnbench/svnbench.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svnbench/svnbench.c (original)
+++ subversion/branches/multi-wc-format/subversion/svnbench/svnbench.c Fri Jan 14 14:01:45 2022
@@ -174,7 +174,7 @@ const apr_getopt_option_t svn_cl__option
/* Long-opt Aliases
*
- * These have NULL desriptions, but an option code that matches some
+ * These have NULL descriptions, but an option code that matches some
* other option (whose description should probably mention its aliases).
*/
Modified: subversion/branches/multi-wc-format/subversion/svndumpfilter/svndumpfilter.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svndumpfilter/svndumpfilter.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svndumpfilter/svndumpfilter.c (original)
+++ subversion/branches/multi-wc-format/subversion/svndumpfilter/svndumpfilter.c Fri Jan 14 14:01:45 2022
@@ -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"
@@ -1467,7 +1468,7 @@ sub_main(int *exit_code, int argc, const
/* 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;
Propchange: subversion/branches/multi-wc-format/subversion/svnfsfs/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Jan 14 14:01:45 2022
@@ -1 +1,2 @@
svnfsfs
+.libs
Modified: subversion/branches/multi-wc-format/subversion/svnfsfs/dump-index-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svnfsfs/dump-index-cmd.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svnfsfs/dump-index-cmd.c (original)
+++ subversion/branches/multi-wc-format/subversion/svnfsfs/dump-index-cmd.c Fri Jan 14 14:01:45 2022
@@ -79,6 +79,7 @@ dump_index(const char *path,
apr_pool_t *pool)
{
svn_fs_t *fs;
+ svn_fs_fs__ioctl_dump_index_input_t input = {0};
/* Check repository type and open it. */
SVN_ERR(open_fs(&fs, path, pool));
@@ -87,8 +88,10 @@ dump_index(const char *path,
printf(" Start Length Type Revision Item Checksum\n");
/* Dump the whole index contents */
- SVN_ERR(svn_fs_fs__dump_index(fs, revision, dump_index_entry, NULL,
- check_cancel, NULL, pool));
+ input.revision = revision;
+ input.callback_func = dump_index_entry;
+ SVN_ERR(svn_fs_ioctl(fs, SVN_FS_FS__IOCTL_DUMP_INDEX, &input, NULL,
+ check_cancel, NULL, pool, pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/multi-wc-format/subversion/svnfsfs/load-index-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svnfsfs/load-index-cmd.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svnfsfs/load-index-cmd.c (original)
+++ subversion/branches/multi-wc-format/subversion/svnfsfs/load-index-cmd.c Fri Jan 14 14:01:45 2022
@@ -109,7 +109,7 @@ parse_index_line(svn_fs_fs__p2l_entry_t
SVN_ERR(token_to_i64(&value, tokens, 1, 16));
result->size = (apr_off_t)value;
- /* Parse the rightmost colum that we care of. */
+ /* Parse the rightmost column that we care of. */
SVN_ERR(token_to_i64(&value, tokens, 4, 10));
result->item.number = (apr_uint64_t)value;
@@ -135,6 +135,7 @@ load_index(const char *path,
svn_revnum_t revision = SVN_INVALID_REVNUM;
apr_array_header_t *entries = apr_array_make(pool, 16, sizeof(void*));
apr_pool_t *iterpool = svn_pool_create(pool);
+ svn_fs_fs__ioctl_load_index_input_t ioctl_input = {0};
/* Check repository type and open it. */
SVN_ERR(open_fs(&fs, path, pool));
@@ -173,7 +174,10 @@ load_index(const char *path,
}
/* Rewrite the indexes. */
- SVN_ERR(svn_fs_fs__load_index(fs, revision, entries, iterpool));
+ ioctl_input.revision = revision;
+ ioctl_input.entries = entries;
+ SVN_ERR(svn_fs_ioctl(fs, SVN_FS_FS__IOCTL_LOAD_INDEX, &ioctl_input, NULL,
+ NULL, NULL, pool, pool));
svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
Modified: subversion/branches/multi-wc-format/subversion/svnfsfs/stats-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svnfsfs/stats-cmd.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svnfsfs/stats-cmd.c (original)
+++ subversion/branches/multi-wc-format/subversion/svnfsfs/stats-cmd.c Fri Jan 14 14:01:45 2022
@@ -500,15 +500,17 @@ svn_error_t *
subcommand__stats(apr_getopt_t *os, void *baton, apr_pool_t *pool)
{
svnfsfs__opt_state *opt_state = baton;
- svn_fs_fs__stats_t *stats;
svn_fs_t *fs;
+ svn_fs_fs__ioctl_get_stats_input_t input = {0};
+ svn_fs_fs__ioctl_get_stats_output_t *output;
printf("Reading revisions\n");
SVN_ERR(open_fs(&fs, opt_state->repository_path, pool));
- SVN_ERR(svn_fs_fs__get_stats(&stats, fs, print_progress, NULL,
- check_cancel, NULL, pool, pool));
- print_stats(stats, pool);
+ input.progress_func = print_progress;
+ SVN_ERR(svn_fs_ioctl(fs, SVN_FS_FS__IOCTL_GET_STATS, &input, (void **)&output,
+ check_cancel, NULL, pool, pool));
+ print_stats(output->stats, pool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/multi-wc-format/subversion/svnlook/svnlook.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svnlook/svnlook.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svnlook/svnlook.c (original)
+++ subversion/branches/multi-wc-format/subversion/svnlook/svnlook.c Fri Jan 14 14:01:45 2022
@@ -1323,7 +1323,7 @@ do_log(svnlook_ctxt_t *c, svn_boolean_t
return SVN_NO_ERROR;
}
- /* We immitate what svn_cmdline_printf does here, since we need the byte
+ /* We imitate what svn_cmdline_printf does here, since we need the byte
size of what we are going to print. */
SVN_ERR(svn_subst_translate_cstring2(prop_value->data, &prop_value_eol,
Modified: subversion/branches/multi-wc-format/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svnmucc/svnmucc.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svnmucc/svnmucc.c (original)
+++ subversion/branches/multi-wc-format/subversion/svnmucc/svnmucc.c Fri Jan 14 14:01:45 2022
@@ -632,7 +632,7 @@ sub_main(int *exit_code, int argc, const
case config_inline_opt:
SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, arg, pool));
SVN_ERR(svn_cmdline__parse_config_option(config_options, opt_arg,
- "svnmucc: ",
+ "svnmucc: ",
pool));
break;
case no_auth_cache_opt:
Modified: subversion/branches/multi-wc-format/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svnrdump/load_editor.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/multi-wc-format/subversion/svnrdump/load_editor.c Fri Jan 14 14:01:45 2022
@@ -576,7 +576,8 @@ set_revision_property(void *baton,
{
if (! svn_hash_gets(rb->pb->skip_revprops, name))
svn_hash_sets(rb->revprop_table,
- apr_pstrdup(rb->pool, name), value);
+ apr_pstrdup(rb->pool, name),
+ svn_string_dup(value, rb->pool));
}
else if (rb->head_rev_before_commit == 0
&& ! svn_hash_gets(rb->pb->skip_revprops, name))
@@ -591,9 +592,9 @@ set_revision_property(void *baton,
/* Remember any datestamp/ author that passes through (see comment
in close_revision). */
if (!strcmp(name, SVN_PROP_REVISION_DATE))
- rb->datestamp = value;
+ rb->datestamp = svn_string_dup(value, rb->pool);
if (!strcmp(name, SVN_PROP_REVISION_AUTHOR))
- rb->author = value;
+ rb->author = svn_string_dup(value, rb->pool);
return SVN_NO_ERROR;
}
@@ -636,7 +637,7 @@ set_node_property(void *baton,
prop = apr_palloc(nb->rb->pool, sizeof (*prop));
prop->name = apr_pstrdup(pool, name);
- prop->value = value;
+ prop->value = svn_string_dup(value, pool);
svn_hash_sets(nb->prop_changes, prop->name, prop);
return SVN_NO_ERROR;
@@ -861,16 +862,12 @@ close_revision(void *baton)
{
if (!svn_hash_gets(rb->pb->skip_revprops, SVN_PROP_REVISION_DATE))
{
- SVN_ERR(svn_repos__validate_prop(SVN_PROP_REVISION_DATE,
- rb->datestamp, rb->pool));
SVN_ERR(svn_ra_change_rev_prop2(rb->pb->session, committed_rev,
SVN_PROP_REVISION_DATE,
NULL, rb->datestamp, rb->pool));
}
if (!svn_hash_gets(rb->pb->skip_revprops, SVN_PROP_REVISION_AUTHOR))
{
- SVN_ERR(svn_repos__validate_prop(SVN_PROP_REVISION_AUTHOR,
- rb->author, rb->pool));
SVN_ERR(svn_ra_change_rev_prop2(rb->pb->session, committed_rev,
SVN_PROP_REVISION_AUTHOR,
NULL, rb->author, rb->pool));
Modified: subversion/branches/multi-wc-format/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svnrdump/svnrdump.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/multi-wc-format/subversion/svnrdump/svnrdump.c Fri Jan 14 14:01:45 2022
@@ -925,7 +925,7 @@ sub_main(int *exit_code, int argc, const
SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
SVN_ERR(svn_cmdline__parse_config_option(config_options,
- opt_arg,
+ opt_arg,
"svnrdump: ",
pool));
break;
Modified: subversion/branches/multi-wc-format/subversion/svnrdump/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svnrdump/util.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svnrdump/util.c (original)
+++ subversion/branches/multi-wc-format/subversion/svnrdump/util.c Fri Jan 14 14:01:45 2022
@@ -46,8 +46,8 @@ svn_rdump__normalize_props(apr_hash_t **
svn_pool_clear(iterpool);
SVN_ERR(svn_repos__normalize_prop(&value, NULL, key, value,
- result_pool, iterpool));
- svn_hash_sets(*normal_props, key, value);
+ iterpool, iterpool));
+ svn_hash_sets(*normal_props, key, svn_string_dup(value, result_pool));
}
svn_pool_destroy(iterpool);
Modified: subversion/branches/multi-wc-format/subversion/svnserve/logger.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svnserve/logger.c?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svnserve/logger.c (original)
+++ subversion/branches/multi-wc-format/subversion/svnserve/logger.c Fri Jan 14 14:01:45 2022
@@ -88,19 +88,21 @@ logger__create(logger_t **logger,
return SVN_NO_ERROR;
}
-void
-logger__log_error(logger_t *logger,
- svn_error_t *err,
- repository_t *repository,
- client_info_t *client_info)
+static void
+log_message(logger_t *logger,
+ const svn_error_t *err,
+ const char *prefix,
+ repository_t *repository,
+ client_info_t *client_info)
{
if (logger && err)
{
const char *timestr, *continuation;
const char *user, *repos, *remote_host;
- char errbuf[256];
+
/* 8192 from MAX_STRING_LEN in from httpd-2.2.4/include/httpd.h */
- char errstr[8192];
+ const apr_size_t errstr_size = 8192;
+ char *errstr = apr_palloc(logger->pool, errstr_size);
svn_error_clear(svn_mutex__lock(logger->mutex));
@@ -118,21 +120,22 @@ logger__log_error(logger_t *logger,
continuation = "";
while (err)
{
+ char errbuf[256];
const char *message = svn_err_best_message(err, errbuf, sizeof(errbuf));
/* based on httpd-2.2.4/server/log.c:log_error_core */
- apr_size_t len = apr_snprintf(errstr, sizeof(errstr),
+ apr_size_t len = apr_snprintf(errstr, errstr_size,
"%" APR_PID_T_FMT
- " %s %s %s %s ERR%s %s %ld %d ",
+ " %s %s %s %s %s%s %s %ld %d ",
getpid(), timestr, remote_host, user,
- repos, continuation,
+ repos, prefix, continuation,
err->file ? err->file : "-", err->line,
err->apr_err);
len += escape_errorlog_item(errstr + len, message,
- sizeof(errstr) - len);
+ errstr_size - len);
/* Truncate for the terminator (as apr_snprintf does) */
- if (len > sizeof(errstr) - sizeof(APR_EOL_STR)) {
- len = sizeof(errstr) - sizeof(APR_EOL_STR);
+ if (len > errstr_size - sizeof(APR_EOL_STR)) {
+ len = errstr_size - sizeof(APR_EOL_STR);
}
memcpy(errstr + len, APR_EOL_STR, sizeof(APR_EOL_STR));
@@ -150,6 +153,24 @@ logger__log_error(logger_t *logger,
}
}
+void
+logger__log_error(logger_t *logger,
+ const svn_error_t *err,
+ repository_t *repository,
+ client_info_t *client_info)
+{
+ log_message(logger, err, "ERR", repository, client_info);
+}
+
+void
+logger__log_warning(logger_t *logger,
+ const svn_error_t *err,
+ repository_t *repository,
+ client_info_t *client_info)
+{
+ log_message(logger, err, "WARN", repository, client_info);
+}
+
svn_error_t *
logger__write(logger_t *logger,
const char *errstr,
Modified: subversion/branches/multi-wc-format/subversion/svnserve/logger.h
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/svnserve/logger.h?rev=1897034&r1=1897033&r2=1897034&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/svnserve/logger.h (original)
+++ subversion/branches/multi-wc-format/subversion/svnserve/logger.h Fri Jan 14 14:01:45 2022
@@ -64,14 +64,21 @@ logger__write(logger_t *logger,
/* Write a description of ERR with additional information from REPOSITORY
* and CLIENT_INFO to the log file managed by LOGGER. REPOSITORY as well
* as CLIENT_INFO may be NULL. If either ERR or LOGGER are NULL, this
- * becomes a no-op.
+ * becomes a no-op. Does not clear ERR.
*/
void
logger__log_error(logger_t *logger,
- svn_error_t *err,
+ const svn_error_t *err,
repository_t *repository,
client_info_t *client_info);
+/* Like logger__log_error() but for warnings. */
+void
+logger__log_warning(logger_t *logger,
+ const svn_error_t *err,
+ repository_t *repository,
+ client_info_t *client_info);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */