[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r10623 - in trunk/subversion: clients/cmdline libsvn_subr mod_dav_svn

From: Erik Huelsmann <e.huelsmann_at_gmx.net>
Date: 2004-08-14 01:10:17 CEST

/me tries to hide in shame.

This was not ready to be committed. Reverted in r10624. I'm extremely sorry!

bye,

Erik.

> Author: dionisos
> Date: Fri Aug 13 17:45:44 2004
> New Revision: 10623
>
> Modified:
> trunk/subversion/clients/cmdline/blame-cmd.c
> trunk/subversion/clients/cmdline/log-cmd.c
> trunk/subversion/libsvn_subr/cmdline.c
> trunk/subversion/mod_dav_svn/repos.c
> trunk/subversion/mod_dav_svn/update.c
> Log:
> Fix alexis bots accepting /msg input where they were not allowed in
> /query.
>
> Modified: trunk/subversion/clients/cmdline/blame-cmd.c
> Url:
>
http://svn.collab.net/viewcvs/svn/trunk/subversion/clients/cmdline/blame-cmd.c?view=diff&rev=10623&p1=trunk/subversion/clients/cmdline/blame-cmd.c&r1=10622&p2=trunk/subversion/clients/cmdline/blame-cmd.c&r2=10623
>
==============================================================================
> --- trunk/subversion/clients/cmdline/blame-cmd.c (original)
> +++ trunk/subversion/clients/cmdline/blame-cmd.c Fri Aug 13 17:45:44 2004
> @@ -52,10 +52,14 @@
> apr_time_t atime;
> const char *time_utf8;
> const char *time_stdout;
> + const char *author_stdout;
> const char *rev_str = SVN_IS_VALID_REVNUM (revision)
> ? apr_psprintf (pool, "%6ld", revision)
> : " -";
> -
> +
> + if (author)
> + SVN_ERR (svn_cmdline_cstring_from_utf8 (&author_stdout, author,
> pool));
> +
> if (opt_state->verbose)
> {
> if (date)
> @@ -71,13 +75,13 @@
> line contents will be misaligned. */
> time_stdout = " -";
> return svn_stream_printf (out, pool, "%s %10s %s %s\n", rev_str,
> - author ? author : " -",
> + author ? author_stdout : " -",
> time_stdout , line);
> }
> else
> {
> return svn_stream_printf (out, pool, "%s %10s %s\n", rev_str,
> - author ? author : " -", line);
> + author ? author_stdout : " -",
> line);
> }
> }
>
>
> Modified: trunk/subversion/clients/cmdline/log-cmd.c
> Url:
>
http://svn.collab.net/viewcvs/svn/trunk/subversion/clients/cmdline/log-cmd.c?view=diff&rev=10623&p1=trunk/subversion/clients/cmdline/log-cmd.c&r1=10622&p2=trunk/subversion/clients/cmdline/log-cmd.c&r2=10623
>
==============================================================================
> --- trunk/subversion/clients/cmdline/log-cmd.c (original)
> +++ trunk/subversion/clients/cmdline/log-cmd.c Fri Aug 13 17:45:44 2004
> @@ -86,9 +86,6 @@
>
> /* Don't print log message body nor its line count. */
> svn_boolean_t omit_log_message;
> -
> - /* Output stream */
> - svn_stream_t *out;
> };
>
>
> @@ -185,9 +182,6 @@
> apr_pool_t *pool)
> {
> struct log_receiver_baton *lb = baton;
> - const char *author_stdout, *date_stdout;
> - const char *msg_stdout = NULL; /* Silence a gcc uninitialized
> warning */
> - svn_error_t *err;
>
> /* Number of lines in the msg. */
> int lines;
> @@ -197,9 +191,9 @@
>
> if (rev == 0)
> {
> - return svn_stream_printf (lb->out, pool,
> - _("No commit for revision 0.%s"),
> - APR_EOL_STR);
> + return svn_cmdline_printf (pool,
> + _("No commit for revision 0.%s"),
> + APR_EOL_STR);
> }
>
> /* ### See http://subversion.tigris.org/issues/show_bug.cgi?id=807
> @@ -208,27 +202,16 @@
> if (author == NULL)
> author = _("(no author)");
>
> - err = svn_cmdline_cstring_from_utf8 (&author_stdout, author, pool);
> - if (err && (APR_STATUS_IS_EINVAL (err->apr_err)))
> - {
> - author_stdout = svn_cmdline_cstring_from_utf8_fuzzy (author, pool);
> - svn_error_clear (err);
> - }
> - else if (err)
> - return err;
> -
> if (date && date[0])
> {
> /* Convert date to a format for humans. */
> apr_time_t time_temp;
> - const char *date_utf8;
>
> SVN_ERR (svn_time_from_cstring (&time_temp, date, pool));
> - date_utf8 = svn_time_to_human_cstring(time_temp, pool);
> - SVN_ERR (svn_cmdline_cstring_from_utf8 (&date_stdout, date_utf8,
> pool));
> + date = svn_time_to_human_cstring(time_temp, pool);
> }
> else
> - date_stdout = _("(no date)");
> + date = _("(no date)");
>
> if (! lb->omit_log_message)
> {
> @@ -236,29 +219,29 @@
> msg = "";
>
> {
> - /* Convert log message from UTF8/LF to native locale and
> eol-style. */
> + /* Convert log message from LF to native eol-style. */
> svn_string_t *logmsg = svn_string_create (msg, pool);
> - SVN_ERR (svn_subst_detranslate_string (&logmsg, logmsg, TRUE,
> pool));
> - msg_stdout = logmsg->data;
> + SVN_ERR (svn_subst_detranslate_string (&logmsg, logmsg, FALSE,
> pool));
> + msg = logmsg->data;
> }
> }
>
> - SVN_ERR (svn_stream_printf (lb->out, pool, SEP_STRING));
> + SVN_ERR (svn_cmdline_printf (pool, "%s", SEP_STRING));
>
> - SVN_ERR (svn_stream_printf (lb->out, pool,
> - "r%ld | %s | %s",
> - rev, author_stdout, date_stdout));
> + SVN_ERR (svn_cmdline_printf (pool,
> + "r%ld | %s | %s",
> + rev, author, date));
>
> if (! lb->omit_log_message)
> {
> - lines = num_lines (msg_stdout);
> + lines = num_lines (msg);
> /*### FIXME: how do we translate this without ngettext?! */
> - SVN_ERR (svn_stream_printf (lb->out, pool,
> - " | %d line%s", lines,
> - (lines > 1) ? "s" : ""));
> + SVN_ERR (svn_cmdline_printf (pool,
> + " | %d line%s", lines,
> + (lines > 1) ? "s" : ""));
> }
>
> - SVN_ERR (svn_stream_printf (lb->out, pool, APR_EOL_STR));
> + SVN_ERR (svn_cmdline_printf (pool, APR_EOL_STR));
>
> if (changed_paths)
> {
> @@ -269,13 +252,13 @@
> sorted_paths = svn_sort__hash (changed_paths,
> svn_sort_compare_items_as_paths,
> pool);
>
> - SVN_ERR (svn_stream_printf (lb->out, pool,
> - _("Changed paths:%s"), APR_EOL_STR));
> + SVN_ERR (svn_cmdline_printf (pool,
> + _("Changed paths:%s"), APR_EOL_STR));
> for (i = 0; i < sorted_paths->nelts; i++)
> {
> svn_sort__item_t *item = &(APR_ARRAY_IDX (sorted_paths, i,
> svn_sort__item_t));
> - const char *path_stdout, *path = item->key;
> + const char *path = item->key;
> svn_log_changed_path_t *log_item
> = apr_hash_get (changed_paths, item->key, item->klen);
> const char *copy_data = "";
> @@ -283,26 +266,22 @@
> if (log_item->copyfrom_path
> && SVN_IS_VALID_REVNUM (log_item->copyfrom_rev))
> {
> - SVN_ERR (svn_cmdline_cstring_from_utf8
> - (&path_stdout, log_item->copyfrom_path, pool));
> copy_data
> = apr_psprintf (pool,
> _(" (from %s:%ld)"),
> - path_stdout,
> + log_item->copyfrom_path,
> log_item->copyfrom_rev);
> }
> - SVN_ERR (svn_cmdline_cstring_from_utf8 (&path_stdout, path,
> pool));
> - SVN_ERR (svn_stream_printf (lb->out, pool, " %c %s%s"
> APR_EOL_STR,
> - log_item->action, path_stdout,
> - copy_data));
> + SVN_ERR (svn_cmdline_printf (pool, " %c %s%s" APR_EOL_STR,
> + log_item->action, path,
> + copy_data));
> }
> }
>
> if (! lb->omit_log_message)
> {
> /* A blank line always precedes the log message. */
> - SVN_ERR (svn_stream_printf (lb->out, pool, APR_EOL_STR "%s"
> APR_EOL_STR,
> - msg_stdout));
> + SVN_ERR (svn_cmdline_printf (pool, APR_EOL_STR "%s" APR_EOL_STR,
> msg));
> }
>
> return SVN_NO_ERROR;
> @@ -461,7 +440,7 @@
> /* </logentry> */
> svn_xml_make_close_tag (&sb, pool, "logentry");
>
> - SVN_ERR (svn_stream_printf (lb->out, pool, "%s", sb->data));
> + SVN_ERR (svn_cmdline_printf (pool, "%s", sb->data));
>
> return SVN_NO_ERROR;
> }
> @@ -522,7 +501,6 @@
> lb.cancel_func = ctx->cancel_func;
> lb.cancel_baton = ctx->cancel_baton;
> lb.omit_log_message = opt_state->quiet;
> - SVN_ERR (svn_stream_for_stdout (&lb.out, pool));
>
> if (! opt_state->quiet)
> svn_cl__get_notifier (&ctx->notify_func, &ctx->notify_baton, FALSE,
> FALSE,
> @@ -543,7 +521,7 @@
> /* "<log>" */
> svn_xml_make_open_tag (&sb, pool, svn_xml_normal, "log", NULL);
>
> - SVN_ERR (svn_stream_printf (lb.out, pool, "%s", sb->data));
> + SVN_ERR (svn_cmdline_printf (pool, "%s", sb->data));
> }
>
> SVN_ERR (svn_client_log (targets,
> @@ -563,7 +541,7 @@
> /* "</log>" */
> svn_xml_make_close_tag (&sb, pool, "log");
>
> - SVN_ERR (svn_stream_printf (lb.out, pool, "%s", sb->data));
> + SVN_ERR (svn_cmdline_printf (pool, "%s", sb->data));
> }
> }
> else /* default output format */
> @@ -586,7 +564,7 @@
> pool));
>
> if (! opt_state->incremental)
> - SVN_ERR (svn_stream_printf (lb.out, pool, SEP_STRING));
> + SVN_ERR (svn_cmdline_printf (pool, SEP_STRING));
> }
>
> return SVN_NO_ERROR;
>
> Modified: trunk/subversion/libsvn_subr/cmdline.c
> Url:
>
http://svn.collab.net/viewcvs/svn/trunk/subversion/libsvn_subr/cmdline.c?view=diff&rev=10623&p1=trunk/subversion/libsvn_subr/cmdline.c&r1=10622&p2=trunk/subversion/libsvn_subr/cmdline.c&r2=10623
>
==============================================================================
> --- trunk/subversion/libsvn_subr/cmdline.c (original)
> +++ trunk/subversion/libsvn_subr/cmdline.c Fri Aug 13 17:45:44 2004
> @@ -304,3 +304,32 @@
>
> return SVN_NO_ERROR;
> }
> +
> +
> +/*** Stream to recode output to the current locale (from UTF-8) */
> +struct baton_recode {
> + apr_xlate_t *xlate_handle;
> + apr_pool_t *pool;
> + svn_stream_t *forwarding_stream;
> +}
> +
> +svn_error_t *
> +write_recoded (void *baton, const char *data, apr_size_t *len)
> +{
> + struct baton_recode *btn = baton;
> +
> + // recode here
> +
> +}
> +
> +svn_stream_t *
> +svn_cmdline_create_stream_from_utf8 (pool, svn_stream_t* forward_to)
> +{
> + struct baton_recode *baton = apr_palloc (pool, sizeof(*baton));
> + svn_stream_t * = svn_stream_create (pool, baton);
> +
> + baton->pool = pool;
> + baton->forwarding_stream = forward_to;
> +
> + svn_stream_set_write (stream, write_recoded);
> +}
>
> Modified: trunk/subversion/mod_dav_svn/repos.c
> Url:
>
http://svn.collab.net/viewcvs/svn/trunk/subversion/mod_dav_svn/repos.c?view=diff&rev=10623&p1=trunk/subversion/mod_dav_svn/repos.c&r1=10622&p2=trunk/subversion/mod_dav_svn/repos.c&r2=10623
>
==============================================================================
> --- trunk/subversion/mod_dav_svn/repos.c (original)
> +++ trunk/subversion/mod_dav_svn/repos.c Fri Aug 13 17:45:44 2004
> @@ -2072,6 +2072,7 @@
>
> for (i = 0; i < sorted->nelts; ++i)
> {
> + //###FIXME: we need a subpool here?!
> const svn_sort__item_t *item = &APR_ARRAY_IDX(sorted, i,
> const
> svn_sort__item_t);
> const svn_fs_dirent_t *entry = item->value;
> @@ -2641,6 +2642,7 @@
> params->pool);
>
> /* iterate over the children in this collection */
> + //###FIXME: how about using params_subpool here?!
> for (hi = apr_hash_first(params->pool, children); hi; hi =
> apr_hash_next(hi))
> {
> const void *key;
>
> Modified: trunk/subversion/mod_dav_svn/update.c
> Url:
>
http://svn.collab.net/viewcvs/svn/trunk/subversion/mod_dav_svn/update.c?view=diff&rev=10623&p1=trunk/subversion/mod_dav_svn/update.c&r1=10622&p2=trunk/subversion/mod_dav_svn/update.c&r2=10623
>
==============================================================================
> --- trunk/subversion/mod_dav_svn/update.c (original)
> +++ trunk/subversion/mod_dav_svn/update.c Fri Aug 13 17:45:44 2004
> @@ -1048,7 +1048,9 @@
> /* Note that child->name might not match any of the cases below.
> Thus, the check for non-empty cdata in each of these cases
> cannot be moved to the top of the loop, because then it would
> - wrongly catch other elements that do allow empty cdata. */
> + wrongly catch other elements that do allow empty cdata. */
> +
> + //###FIXME: do we need a subpool here?
>
> if (child->ns == ns && strcmp(child->name, "target-revision") == 0)
> {
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
>

-- 
NEU: WLAN-Router für 0,- EUR* - auch für DSL-Wechsler!
GMX DSL = supergünstig & kabellos http://www.gmx.net/de/go/dsl
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Aug 14 01:10:35 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.