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 2017/12/15 12:08:01 UTC
svn commit: r1818275 - in /subversion/branches/shelve-checkpoint: ./
subversion/bindings/javahl/src/org/apache/subversion/javahl/
subversion/include/ subversion/include/private/ subversion/libsvn_client/
subversion/libsvn_delta/ subversion/svn/ subvers...
Author: julianfoad
Date: Fri Dec 15 12:08:00 2017
New Revision: 1818275
URL: http://svn.apache.org/viewvc?rev=1818275&view=rev
Log:
On the 'shelve-checkpoint3' branch: Catch up with trunk@1818270.
Added:
subversion/branches/shelve-checkpoint/subversion/tests/cmdline/shelve_tests.py
- copied unchanged from r1818270, subversion/trunk/subversion/tests/cmdline/shelve_tests.py
subversion/branches/shelve-checkpoint/tools/dist/create-minor-release-branch.py
- copied unchanged from r1818270, subversion/trunk/tools/dist/create-minor-release-branch.py
Modified:
subversion/branches/shelve-checkpoint/ (props changed)
subversion/branches/shelve-checkpoint/CHANGES
subversion/branches/shelve-checkpoint/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java
subversion/branches/shelve-checkpoint/subversion/include/private/svn_element.h
subversion/branches/shelve-checkpoint/subversion/include/svn_client.h
subversion/branches/shelve-checkpoint/subversion/include/svn_diff.h
subversion/branches/shelve-checkpoint/subversion/include/svn_version.h
subversion/branches/shelve-checkpoint/subversion/libsvn_client/shelve.c
subversion/branches/shelve-checkpoint/subversion/libsvn_delta/element.c
subversion/branches/shelve-checkpoint/subversion/svn/help-cmd.c
subversion/branches/shelve-checkpoint/subversion/svn/svn.c
subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svntest/main.py
subversion/branches/shelve-checkpoint/tools/client-side/bash_completion
subversion/branches/shelve-checkpoint/tools/client-side/bash_completion_test
Propchange: subversion/branches/shelve-checkpoint/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 15 12:08:00 2017
@@ -98,4 +98,4 @@
/subversion/branches/verify-at-commit:1462039-1462408
/subversion/branches/verify-keep-going:1439280-1546110
/subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1801593-1817373
+/subversion/trunk:1801593-1818270
Modified: subversion/branches/shelve-checkpoint/CHANGES
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/CHANGES?rev=1818275&r1=1818274&r2=1818275&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/CHANGES (original)
+++ subversion/branches/shelve-checkpoint/CHANGES Fri Dec 15 12:08:00 2017
@@ -1,3 +1,8 @@
+Version 1.11.0
+(?? ??? 20XX, from /branches/1.11.x)
+http://svn.apache.org/repos/asf/subversion/tags/1.11.0
+
+
Version 1.10.0
(?? ??? 2017, from /branches/1.10.x)
http://svn.apache.org/repos/asf/subversion/tags/1.10.0
Modified: subversion/branches/shelve-checkpoint/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java?rev=1818275&r1=1818274&r2=1818275&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java (original)
+++ subversion/branches/shelve-checkpoint/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java Fri Dec 15 12:08:00 2017
@@ -141,12 +141,15 @@ public class NativeResources
*/
private static final void init()
{
+ final int SVN_VER_MAJOR = 1;
+ final int SVN_VER_MINOR = 11;
initNativeLibrary();
version = new Version();
- if (!version.isAtLeast(1, 10, 0))
+ if (!version.isAtLeast(SVN_VER_MAJOR, SVN_VER_MINOR, 0))
{
throw new LinkageError("Native library version must be at least " +
- "1.10.0, but is only " + version);
+ SVN_VER_MAJOR + "." + SVN_VER_MINOR + ".0," +
+ "but is only " + version);
}
runtimeVersion = new RuntimeVersion();
Modified: subversion/branches/shelve-checkpoint/subversion/include/private/svn_element.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/include/private/svn_element.h?rev=1818275&r1=1818274&r2=1818275&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/include/private/svn_element.h (original)
+++ subversion/branches/shelve-checkpoint/subversion/include/private/svn_element.h Fri Dec 15 12:08:00 2017
@@ -348,7 +348,7 @@ svn_element__content_t *
svn_element__tree_get(const svn_element__tree_t *tree,
int eid);
-svn_error_t *
+void
svn_element__tree_set(svn_element__tree_t *tree,
int eid,
const svn_element__content_t *element);
Modified: subversion/branches/shelve-checkpoint/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/include/svn_client.h?rev=1818275&r1=1818274&r2=1818275&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/include/svn_client.h (original)
+++ subversion/branches/shelve-checkpoint/subversion/include/svn_client.h Fri Dec 15 12:08:00 2017
@@ -6828,19 +6828,6 @@ svn_client_shelf_set_current_version(svn
int version,
apr_pool_t *scratch_pool);
-/** Set @a *wc_abspaths_p to the files affected by version @a version
- * of @a shelf.
- *
- * @since New in 1.X.
- * @warning EXPERIMENTAL.
- */
-SVN_EXPERIMENTAL
-svn_error_t *
-svn_client_shelf_get_files(apr_array_header_t **wc_abspaths_p,
- svn_client_shelf_t *shelf,
- int version,
- apr_pool_t *scratch_pool);
-
/** Output version @a version of @a shelf as a patch to @a outstream.
*
* @since New in 1.X.
@@ -6882,7 +6869,7 @@ svn_client_shelf_version_get_info(svn_cl
* the new path, both relative to the WC root. The key and value are the
* same except when a path is moved or copied.
*
- * @since New in 1.X.
+ * @since New in 1.10, changed in 1.X.
* @warning EXPERIMENTAL.
*/
SVN_EXPERIMENTAL
@@ -6893,6 +6880,20 @@ svn_client_shelf_get_paths(apr_hash_t **
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/** Set @a *has_changes to indicate whether @a shelf @a version
+ * contains any modifications, in other words if svn_client_shelf_get_paths()
+ * would return a non-empty set of paths.
+ *
+ * @since New in 1.10.
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client_shelf_has_changes(svn_boolean_t *has_changes,
+ svn_client_shelf_t *shelf,
+ int version,
+ apr_pool_t *scratch_pool);
+
/** Set the log message in @a shelf, using the log message callbacks in
* the client context.
*
Modified: subversion/branches/shelve-checkpoint/subversion/include/svn_diff.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/include/svn_diff.h?rev=1818275&r1=1818274&r2=1818275&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/include/svn_diff.h (original)
+++ subversion/branches/shelve-checkpoint/subversion/include/svn_diff.h Fri Dec 15 12:08:00 2017
@@ -1246,6 +1246,9 @@ svn_diff_get_binary_diff_result_stream(c
/**
* Data type to manage parsing of patches.
+ *
+ * Represents a patch to one target file.
+ *
* API users should not allocate structures of this type directly.
*
* @since New in 1.7. */
@@ -1272,7 +1275,9 @@ typedef struct svn_patch_t {
svn_diff_operation_kind_t operation;
/**
- * Indicates whether the patch is being interpreted in reverse. */
+ * Indicates whether the patch is being interpreted in reverse.
+ * ### If so, how does this affect the interpretation of other fields?
+ */
svn_boolean_t reverse;
/**
Modified: subversion/branches/shelve-checkpoint/subversion/include/svn_version.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/include/svn_version.h?rev=1818275&r1=1818274&r2=1818275&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/include/svn_version.h (original)
+++ subversion/branches/shelve-checkpoint/subversion/include/svn_version.h Fri Dec 15 12:08:00 2017
@@ -61,7 +61,7 @@ extern "C" {
* Modify when new functionality is added or new interfaces are
* defined, but all changes are backward compatible.
*/
-#define SVN_VER_MINOR 10
+#define SVN_VER_MINOR 11
/**
* Patch number.
Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_client/shelve.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_client/shelve.c?rev=1818275&r1=1818274&r2=1818275&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_client/shelve.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_client/shelve.c Fri Dec 15 12:08:00 2017
@@ -400,6 +400,20 @@ svn_client_shelf_get_paths(apr_hash_t **
}
svn_error_t *
+svn_client_shelf_has_changes(svn_boolean_t *has_changes,
+ svn_client_shelf_t *shelf,
+ int version,
+ apr_pool_t *scratch_pool)
+{
+ apr_hash_t *patch_paths;
+
+ SVN_ERR(svn_client_shelf_get_paths(&patch_paths, shelf, version,
+ scratch_pool, scratch_pool));
+ *has_changes = (apr_hash_count(patch_paths) != 0);
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
svn_client_shelf_apply(svn_client_shelf_t *shelf,
int version,
svn_boolean_t dry_run,
@@ -457,16 +471,6 @@ svn_client_shelf_set_current_version(svn
return SVN_NO_ERROR;
}
-svn_error_t *
-svn_client_shelf_get_files(apr_array_header_t **wc_abspaths_p,
- svn_client_shelf_t *shelf,
- int version,
- apr_pool_t *scratch_pool)
-{
-
- return SVN_NO_ERROR;
-}
-
svn_error_t *
svn_client_shelf_export_patch(svn_client_shelf_t *shelf,
int version,
Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_delta/element.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_delta/element.c?rev=1818275&r1=1818274&r2=1818275&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_delta/element.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_delta/element.c Fri Dec 15 12:08:00 2017
@@ -375,14 +375,12 @@ svn_element__tree_get(const svn_element_
return svn_eid__hash_get(tree->e_map, eid);
}
-svn_error_t *
+void
svn_element__tree_set(svn_element__tree_t *tree,
int eid,
const svn_element__content_t *element)
{
svn_eid__hash_set(tree->e_map, eid, element);
-
- return SVN_NO_ERROR;
}
void
Modified: subversion/branches/shelve-checkpoint/subversion/svn/help-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/svn/help-cmd.c?rev=1818275&r1=1818274&r2=1818275&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/svn/help-cmd.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/svn/help-cmd.c Fri Dec 15 12:08:00 2017
@@ -148,21 +148,24 @@ svn_cl__help(apr_getopt_t *os,
_("\nThe following authentication credential caches are available:\n\n"));
/*### There is no API to query available providers at run time. */
+ if (config_path)
+ {
#if (defined(WIN32) && !defined(__MINGW32__))
- version_footer =
- svn_stringbuf_create(apr_psprintf(pool, _("%s* Wincrypt cache in %s\n"),
- version_footer->data,
- svn_dirent_local_style(config_path,
- pool)),
- pool);
+ version_footer =
+ svn_stringbuf_create(apr_psprintf(pool, _("%s* Wincrypt cache in %s\n"),
+ version_footer->data,
+ svn_dirent_local_style(config_path,
+ pool)),
+ pool);
#elif !defined(SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE)
- version_footer =
- svn_stringbuf_create(apr_psprintf(pool, _("%s* Plaintext cache in %s\n"),
- version_footer->data,
- svn_dirent_local_style(config_path,
- pool)),
- pool);
+ version_footer =
+ svn_stringbuf_create(apr_psprintf(pool, _("%s* Plaintext cache in %s\n"),
+ version_footer->data,
+ svn_dirent_local_style(config_path,
+ pool)),
+ pool);
#endif
+ }
#ifdef SVN_HAVE_GNOME_KEYRING
svn_stringbuf_appendcstr(version_footer, "* Gnome Keyring\n");
#endif
Modified: subversion/branches/shelve-checkpoint/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/svn/svn.c?rev=1818275&r1=1818274&r2=1818275&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/svn/svn.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/svn/svn.c Fri Dec 15 12:08:00 2017
@@ -458,7 +458,7 @@ const apr_getopt_option_t svn_cl__option
" 'wc-root' root of TARGET's working copy")},
{"adds-as-modification", opt_adds_as_modification, 0,
- N_("Local additions are merged with incoming additions "
+ N_("Local additions are merged with incoming additions\n"
" "
"instead of causing a tree conflict. Use of this\n"
" "
Modified: subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svntest/main.py?rev=1818275&r1=1818274&r2=1818275&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svntest/main.py Fri Dec 15 12:08:00 2017
@@ -56,7 +56,7 @@ import svntest
from svntest import Failure
from svntest import Skip
-SVN_VER_MINOR = 10
+SVN_VER_MINOR = 11
######################################################################
#
Modified: subversion/branches/shelve-checkpoint/tools/client-side/bash_completion
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/tools/client-side/bash_completion?rev=1818275&r1=1818274&r2=1818275&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/tools/client-side/bash_completion (original)
+++ subversion/branches/shelve-checkpoint/tools/client-side/bash_completion Fri Dec 15 12:08:00 2017
@@ -128,7 +128,7 @@ function _svn_complete_target() {
COMPREPLY=( $(compgen -d -S '/' -X '*/.*' -- $cur ) )
return
elif [[ ( $1 == "all" && $cur == ^/* ) || ( "$colon" == ":" && $cur == //*/* ) ]]
- then # we already hava a protocoll and host: autocomplete for svn ls ^/bla | svn ls remote_url | svn checkout remote_url
+ then # we already have a protocol and host: autocomplete for svn ls ^/bla | svn ls remote_url | svn checkout remote_url
local p
if [ "$colon" == ":" ] ; then
p="$prefix$colon"
@@ -447,7 +447,7 @@ _svn()
# then we have an argument
if [[ $cmd = 'merge' && ! $URL ]] ; then
- # fist argument is the source URL for the merge
+ # first argument is the source URL for the merge
URL=$opt
fi
@@ -1151,17 +1151,19 @@ _svnadmin ()
case ${COMP_WORDS[1]} in
create)
cmdOpts="--bdb-txn-nosync --bdb-log-keep --config-dir \
- --fs-type --pre-1.4-compatible --pre-1.5-compatible \
- --pre-1.6-compatible --compatible-version"
+ --fs-type --compatible-version"
;;
deltify)
- cmdOpts="-r --revision -q --quiet"
+ cmdOpts="-r --revision -q --quiet -M --memory-cache-size"
;;
dump)
cmdOpts="-r --revision --incremental -q --quiet --deltas \
-M --memory-cache-size -F --file \
--exclude --include --pattern"
;;
+ dump-revprops)
+ cmdOpts="-r --revision -q --quiet -F --file"
+ ;;
freeze)
cmdOpts="-F --file"
;;
@@ -1169,23 +1171,35 @@ _svnadmin ()
cmdOpts="$cmds"
;;
hotcopy)
- cmdOpts="--clean-logs"
+ cmdOpts="--clean-logs --incremental -q --quiet"
;;
load)
cmdOpts="--ignore-uuid --force-uuid --parent-dir -q --quiet \
--use-pre-commit-hook --use-post-commit-hook \
--bypass-prop-validation -M --memory-cache-size \
- --no-flush-to-disk --normalize-props -F --file"
+ --no-flush-to-disk --normalize-props -F --file \
+ --ignore-dates -r --revision"
+ ;;
+ load-revprops)
+ cmdOpts="-r --revision -q --quiet -F --file \
+ --bypass-prop-validation --normalize-props \
+ --force-uuid --no-flush-to-disk"
;;
lstxns)
cmdOpts="-r --revision"
;;
lock|unlock)
- cmdOpts="--bypass-hooks"
+ cmdOpts="--bypass-hooks -q --quiet"
+ ;;
+ pack)
+ cmdOpts="-M --memory-cache-size -q --quiet"
;;
recover)
cmdOpts="--wait"
;;
+ rmlocks)
+ cmdOpts="-q --quiet"
+ ;;
rmtxns)
cmdOpts="-q --quiet"
;;
@@ -1198,7 +1212,9 @@ _svnadmin ()
--use-post-revprop-change-hook"
;;
verify)
- cmdOpts="-r --revision -q --quiet"
+ cmdOpts="-r --revision -t --transaction -q --quiet \
+ --check-normalization --keep-going \
+ -M --memory-cache-size --metadata-only"
;;
*)
;;
Modified: subversion/branches/shelve-checkpoint/tools/client-side/bash_completion_test
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/tools/client-side/bash_completion_test?rev=1818275&r1=1818274&r2=1818275&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/tools/client-side/bash_completion_test (original)
+++ subversion/branches/shelve-checkpoint/tools/client-side/bash_completion_test Fri Dec 15 12:08:00 2017
@@ -20,9 +20,16 @@
# script produces appropriate lists of completions for various incomplete svn
# command lines.
-if [ ! -f "$1" ] || [ "$2" ]; then
- echo "Usage: bash_completion_test BASH_COMPLETION_PATHNAME"
+THIS_DIR=`dirname "$0"`
+SCRIPT="$1"
+if [ -z "$SCRIPT" ]; then
+ SCRIPT="$THIS_DIR/bash_completion"
+fi
+
+if [ ! -r "$SCRIPT" ] || [ "$2" ]; then
+ echo "Usage: bash_completion_test [BASH_COMPLETION_PATHNAME]"
echo "Tests the specified \"bash_completion\" script,"
+ echo "defaulting to the one in the same directory as this test,"
echo "including checking it against the \"svn\" program found in the current PATH."
exit 1
fi
@@ -32,20 +39,26 @@ shopt -s extglob
export LC_ALL=C
# Execute the script which is to be tested.
-. "$1"
+. "$SCRIPT"
-# From the given incomplete svn command, print a space-separated list of
+# From the given incomplete command, print a space-separated list of
# possible completions of the last argument (or of an empty first argument
# if no subcommand is given).
-# Usage: get_svn_completions [SVN-SUBCOMMAND [SVN-OPTION...]]
-get_svn_completions() {
- COMP_WORDS=(svn "$@")
- if [ $# == 0 ]; then
+#
+# Usage: get_completions SVN-CMD [SVN-SUBCOMMAND [SVN-OPTION...]]
+# where SVN-CMD is "svn", "svnadmin", etc.; such that when a leading
+# underscore is added, it must name one of the completion functions in
+# "bash_completion".
+get_completions() {
+ SVN_CMD="$1"
+ COMP_WORDS=("$@")
+ if [ $# == 1 ]; then
COMP_CWORD=1
else
- COMP_CWORD=$#
+ COMP_CWORD=$(($#-1))
fi
- _svn
+ # Call the appropriate completion function (e.g. "_svn") with no arguments.
+ "_$SVN_CMD"
echo -n "${COMPREPLY[*]}"
}
@@ -62,30 +75,38 @@ fail() {
}
# Check that EXPECTED-WORD is among the completions of the last word in
-# SVN-COMMAND. SVN-COMMAND is a single argument to this function, split
-# into multiple arguments when passed to "get_svn_completions()".
-# Usage: includes SVN-COMMAND EXPECTED-WORD
+# SVN-ARGS. SVN-ARGS is a single argument to this function, split
+# into multiple arguments when passed to "get_completions()".
+# Usage: includes SVN-CMD SVN-ARGS EXPECTED-WORD
includes() {
- COMPLETIONS=`get_svn_completions $1`
- if [[ "$2" != @(${COMPLETIONS// /|}) ]]; then
- fail "completions of \"svn $1\" should include \"$2\"" \
+ SVN_CMD="$1"
+ SVN_ARGS="$2"
+ EXPECTED_WORD="$3"
+ COMPLETIONS=`get_completions "$SVN_CMD" $SVN_ARGS`
+ if [[ "$EXPECTED_WORD" != @(${COMPLETIONS// /|}) ]]; then
+ fail "completions of \"$SVN_CMD $SVN_ARGS\" should include \"$EXPECTED_WORD\"" \
"(completions: $COMPLETIONS)"
fi
}
excludes() {
- COMPLETIONS=`get_svn_completions $1`
- if [[ "$2" == @(${COMPLETIONS// /|}) ]]; then
- fail "completions of \"svn $1\" should exclude \"$2\"" \
+ SVN_CMD="$1"
+ SVN_ARGS="$2"
+ EXPECTED_WORD="$3"
+ COMPLETIONS=`get_completions "$SVN_CMD" $SVN_ARGS`
+ if [[ "$EXPECTED_WORD" == @(${COMPLETIONS// /|}) ]]; then
+ fail "completions of \"$SVN_CMD $SVN_ARGS\" should exclude \"$EXPECTED_WORD\"" \
"(completions: $COMPLETIONS)"
fi
}
-# Print the valid subcommands for "svn", one per line, sorted.
+# Print the valid subcommands for an "svn"-like program, one per line, sorted.
# Exclude any synonym that is just a truncation of its full name.
-# Usage: get_svn_subcommands
+# Usage: get_svn_subcommands SVN-CMD
+# where SVN-CMD is "svn" or another program that outputs similar help.
get_svn_subcommands() {
- svn help |
+ SVN_CMD="$1"
+ "$SVN_CMD" help |
# Find the relevant lines.
sed -n -e '1,/^Available subcommands:$/d;/^$/q;p' |
# Remove brackets and commas
@@ -111,9 +132,12 @@ get_svn_subcommands() {
}
# Print the valid option switches for "svn SUBCMD", one per line, sorted.
-# Usage: get_svn_options SUBCMD
+# Usage: get_svn_options SVN-CMD SUBCMD
+# where SVN-CMD is "svn" or another program that outputs similar help.
get_svn_options() {
- { svn help "$1" |
+ SVN_CMD="$1"
+ SUBCMD="$2"
+ { "$SVN_CMD" help "$SUBCMD" |
# Remove deprecated options
grep -v deprecated |
# Find the relevant lines; remove "arg" and description.
@@ -122,7 +146,7 @@ get_svn_options() {
# Remove brackets; put each word on its own line.
tr -d '] ' | tr '[' '\n'
# The following options are always accepted but not listed in the help
- if [ "$1" != "help" ] ; then
+ if [ "$SUBCMD" != "help" ] ; then
echo "-h"
echo "--help"
fi
@@ -136,36 +160,38 @@ set +e # Do not exit on error
TESTS_FAILED=
echo "Checking general completion"
-includes "he" "help"
-includes "" "help"
-includes "" "--version"
-
-echo "Checking list of subcommands"
-HELP_SUBCMDS=`get_svn_subcommands | tr "\n" " "`
-COMPLETION_SUBCMDS=`get_svn_completions | tr " " "\n" | grep -v "^-" | sort | tr "\n" " "`
-if [ "$HELP_SUBCMDS" != "$COMPLETION_SUBCMDS" ]; then
- fail "non-option completions for \"svn \" != subcommands accepted" \
- " (non-o. cmpl.: $COMPLETION_SUBCMDS)" \
- " (svn accepts: $HELP_SUBCMDS)"
-fi
-
-echo "Checking list of options for each subcommand"
-for SUBCMD in $HELP_SUBCMDS; do
- HELP_OPTIONS=`get_svn_options $SUBCMD | tr "\n" " "`
- COMPLETION_OPTIONS=`get_svn_completions $SUBCMD - | tr " " "\n" | sort | tr "\n" " "`
- if [ "$HELP_OPTIONS" != "$COMPLETION_OPTIONS" ]; then
- fail "completions for \"svn $SUBCMD -\" != options accepted" \
- " (completions: $COMPLETION_OPTIONS)" \
- " (svn accepts: $HELP_OPTIONS)"
+includes svn "he" "help"
+includes svn "" "help"
+includes svn "" "--version"
+
+for SVN_CMD in svn svnadmin svndumpfilter svnlook svnrdump svnsync; do
+ echo "Checking list of subcommands: $SVN_CMD"
+ HELP_SUBCMDS=`get_svn_subcommands "$SVN_CMD" | tr "\n" " "`
+ COMPLETION_SUBCMDS=`get_completions "$SVN_CMD" | tr " " "\n" | grep -v "^-" | sort | tr "\n" " "`
+ if [ "$HELP_SUBCMDS" != "$COMPLETION_SUBCMDS" ]; then
+ fail "non-option completions for \"$SVN_CMD\" != subcommands accepted" \
+ " (non-o. cmpl.: $COMPLETION_SUBCMDS)" \
+ " (help says: $HELP_SUBCMDS)"
fi
+
+ echo "Checking list of options for each subcommand"
+ for SUBCMD in $HELP_SUBCMDS; do
+ HELP_OPTIONS=`get_svn_options $SVN_CMD $SUBCMD | tr "\n" " "`
+ COMPLETION_OPTIONS=`get_completions $SVN_CMD $SUBCMD - | tr " " "\n" | sort | tr "\n" " "`
+ if [ "$HELP_OPTIONS" != "$COMPLETION_OPTIONS" ]; then
+ fail "completions for \"$SVN_CMD $SUBCMD -\" != options accepted" \
+ " (completions: $COMPLETION_OPTIONS)" \
+ " (help says: $HELP_OPTIONS)"
+ fi
+ done
done
echo "Checking rejection of synonyms"
-excludes "diff -x -u -" "-x"
-excludes "diff -x -u --e" "--extensions"
-excludes "diff --extensions -u -" "--extensions"
-excludes "diff --extensions -u -" "-x"
-excludes "diff --extensions=-u -" "-x"
+excludes svn "diff -x -u -" "-x"
+excludes svn "diff -x -u --e" "--extensions"
+excludes svn "diff --extensions -u -" "--extensions"
+excludes svn "diff --extensions -u -" "-x"
+excludes svn "diff --extensions=-u -" "-x"
if [ $TESTS_FAILED ]; then
echo "FAILURE: at least one bash_completion test failed."