After incorporating suggestions from Branko:
2003-02-11 Eric Hanchrow <offby1@blarg.net>
* subversion/svnadmin/main.c: new option `--quiet'.
(struct svnadmin_opt_state): new member.
(subcommand_dump): don't use (or create) stdio_stream if we were
asked to be quiet.
(main): handle new 'q' option.
* doc/book/book/ch08.xml: document new `--quiet' option to
`svnadmin dump'.
Index: subversion/svnadmin/main.c
===================================================================
--- subversion/svnadmin/main.c (revision 4858)
+++ subversion/svnadmin/main.c (working copy)
@@ -115,6 +115,9 @@
{"in-repos-template", svnadmin__in_repos_template, 1,
"specify template for the repository structure"},
+ {"quiet", 'q', 0,
+ "no progress (only errors) to stderr"},
+
{"ignore-uuid", svnadmin__ignore_uuid, 0,
"ignore any repos UUID found in the stream."},
@@ -148,7 +151,7 @@
"revision trees. If only LOWER is given, dump that one revision tree.\n"
"If --incremental is passed, then the first revision dumped will be\n"
"a diff against the previous revision, instead of the usual fulltext.\n",
- {'r', svnadmin__incremental} },
+ {'r', svnadmin__incremental, 'q'} },
{"help", subcommand_help, {"?", "h"},
"usage: svn help [SUBCOMMAND1 [SUBCOMMAND2] ...]\n\n"
@@ -211,6 +214,7 @@
svn_boolean_t help; /* --help or -? */
svn_boolean_t incremental; /* --incremental */
svn_boolean_t follow_copies; /* --copies */
+ svn_boolean_t quiet; /* --quiet */
enum svn_repos_load_uuid uuid_action; /* --ignore-uuid,
--force-uuid */
const char *on_disk;
@@ -264,7 +268,7 @@
struct svnadmin_opt_state *opt_state = baton;
svn_repos_t *repos;
svn_fs_t *fs;
- svn_stream_t *stdout_stream, *stderr_stream;
+ svn_stream_t *stdout_stream, *stderr_stream = NULL;
svn_revnum_t
lower = SVN_INVALID_REVNUM,
upper = SVN_INVALID_REVNUM;
@@ -298,11 +302,17 @@
"first revision cannot be higher than second");
/* Run the dump to STDOUT. Let the user redirect output into
- a file if they want. :-) Progress feedback goes to stderr. */
+ a file if they want. :-) */
SVN_ERR (create_stdio_stream (&stdout_stream,
apr_file_open_stdout, pool));
- SVN_ERR (create_stdio_stream (&stderr_stream,
- apr_file_open_stderr, pool));
+
+ /* Progress feedback goes to stderr, unless they asked to suppress
+ it. */
+ if (!opt_state->quiet)
+ {
+ SVN_ERR (create_stdio_stream (&stderr_stream,
+ apr_file_open_stderr, pool));
+ }
SVN_ERR (svn_repos_dump_fs (repos, stdout_stream, stderr_stream,
lower, upper, opt_state->incremental, pool));
@@ -622,6 +632,9 @@
return EXIT_FAILURE;
}
}
+ break;
+ case 'q':
+ opt_state.quiet = TRUE;
break;
case 'h':
case '?':
Index: doc/book/book/ch08.xml
===================================================================
--- doc/book/book/ch08.xml (revision 4858)
+++ doc/book/book/ch08.xml (working copy)
@@ -3305,7 +3305,13 @@
<screen>
--revision (-r)
--incremental
+--quiet (-q)
</screen>
+
+ <para>The <option>--quiet</option> option suppresses the
+ <computeroutput>Dumped revision
+ <replaceable>FOO</replaceable></computeroutput> messages.
+
</refsect1>
<refsect1>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Feb 13 06:00:22 2003