Author: brane
Date: Mon Dec 17 12:17:40 2012
New Revision: 1422893
URL: http://svn.apache.org/viewvc?rev=1422893&view=rev
Log:
Don't colourize the plaintext-store warning,
and don't ignore too many blank lines in the svn --version tests.
* subversion/libsvn_subr/opt.c (svn_opt__print_version_info):
Remove colour escapes. Add fixme comment about the meaning
of the configuration flag.
* subversion/tests/cmdline/getopt_tests.py (process_lines):
Instead of ignoring all blank lines, skip just the one
after the plaintext-password storage warning.
Modified:
subversion/trunk/subversion/libsvn_subr/opt.c
subversion/trunk/subversion/tests/cmdline/getopt_tests.py
Modified: subversion/trunk/subversion/libsvn_subr/opt.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/opt.c?rev=1422893&r1=1422892&r2=1422893&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/opt.c (original)
+++ subversion/trunk/subversion/libsvn_subr/opt.c Mon Dec 17 12:17:40 2012
@@ -1126,21 +1126,14 @@ svn_opt__print_version_info(const char *
SVN_ERR(svn_cmdline_printf(pool, "%s\n", svn_version_ext_copyright(info)));
#if !defined(SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE) && !defined(WIN32)
- {
- const char *warnstart = "";
- const char *warnend = "";
-
- if (isatty(fileno(stdout)))
- {
- warnstart = "\033[1;31m";
- warnend = "\033[0;m";
- }
-
- SVN_ERR(svn_cmdline_printf(
- pool,
- _("%sWARNING: Plaintext password storage is enabled!%s\n\n"),
- warnstart, warnend));
- }
+ /* FIXME: Checking this config variable is the wrong thing to do,
+ since it apparently means that the simple auth provider is
+ disabled, not that plaintext password storage is disabled.
+ So in either the configure option is misnamed, or its
+ implementation is too simplistic. */
+ SVN_ERR(svn_cmdline_fputs(
+ _("WARNING: Plaintext password storage is enabled!\n\n"),
+ stdout, pool));
#endif /* SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE && !WIN32 */
if (footer)
Modified: subversion/trunk/subversion/tests/cmdline/getopt_tests.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/getopt_tests.py?rev=1422893&r1=1422892&r2=1422893&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/getopt_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/getopt_tests.py Mon Dec 17
12:17:40 2012
@@ -59,6 +59,9 @@ def load_expected_output(basename):
return exp_stdout, exp_stderr
+# With plaintext password storage enabled, `svn --version' emits a warning:
+warn_line_re = re.compile("WARNING: Plaintext password storage")
+
# This is a list of lines to delete.
del_lines_res = [
# In 'svn --version', the date line is variable, for example:
@@ -70,8 +73,6 @@ del_lines_res = [
re.compile(r" - handles '(https?|file|svn)' scheme"),
re.compile(r" - with Cyrus SASL authentication"),
re.compile(r"\* fs_(base|fs) :"),
- re.compile(r"WARNING: Plaintext"),
- re.compile(r"$"), # blank line
]
# This is a list of lines to search and replace text on.
@@ -102,6 +103,7 @@ rep_lines_res = [
switch_res_line = 'System information:'
# This is a list of lines to delete after having seen switch_res_line.
+switched_warn_line_re = None
switched_del_lines_res = [
# In svn --version --verbose, dependent libs loaded
# shared libs are optional.
@@ -121,20 +123,31 @@ switched_rep_lines_res = [
def process_lines(lines):
"delete lines that should not be compared and search and replace the rest"
output = [ ]
+ warn_re = warn_line_re
del_res = del_lines_res
rep_res = rep_lines_res
+ skip_next_line = 0
for line in lines:
+ if skip_next_line:
+ skip_next_line = 0
+ continue
+
if line.startswith(switch_res_line):
+ warn_re = switched_warn_line_re
del_res = switched_del_lines_res
rep_res = switched_rep_lines_res
# Skip these lines from the output list.
delete_line = 0
- for delete_re in del_res:
- if delete_re.match(line):
- delete_line = 1
- break
+ if warn_re and warn_re.match(line):
+ delete_line = 1
+ skip_next_line = 1 # Ignore the empty line after the warning
+ else:
+ for delete_re in del_res:
+ if delete_re.match(line):
+ delete_line = 1
+ break
if delete_line:
continue