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

Re: svn commit: r1492168 - in /subversion/trunk/subversion: svn/cl.h svn/mergeinfo-cmd.c svn/svn.c tests/cmdline/mergeinfo_tests.py

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 12 Jun 2013 17:20:57 +0100 (BST)

> URL: http://svn.apache.org/r1492168

> Log:
> Implement '--log' option for 'svn mergeinfo --show-revs' subcommand to print
> revisions log message, author and date.

> * subversion/svn/mergeinfo-cmd.c
>   (): Include svn_compat.h and svn_props.h.
>   (SEP_STRING, print_log_details): New.
>   (mergeinfo_log): New, mostly extracted from svn_cl__mergeinfo().
>   (svn_cl__mergeinfo): Call mergeinfo_log().
>
> * subversion/svn/svn.c
>   (svn_cl__longopt_t): Add opt_mergeinfo_log.
>   (svn_cl__options): Add description for '--log' option.
>   (svn_cl__cmd_table): Add opt_mergeinfo_log to mergeinfo subcommand.
>   (sub_main): Handle '--log' option.
>
> * subversion/tests/cmdline/mergeinfo_tests.py
>   (mergeinfo_log): New test.
>   (test_list): Add mergeinfo_log.

> Modified: subversion/trunk/subversion/svn/mergeinfo-cmd.c
> ==============================================================================
> --- subversion/trunk/subversion/svn/mergeinfo-cmd.c (original)
> +++ subversion/trunk/subversion/svn/mergeinfo-cmd.c Wed Jun 12 12:06:03 2013
> @@ -55,6 +57,61 @@ print_log_rev(void *baton,
>   return SVN_NO_ERROR;
> }
>
> +/* The separator between log messages. */
> +#define SEP_STRING \
> + 
> "------------------------------------------------------------------------\n"
> +
> +/* Implements the svn_log_entry_receiver_t interface. */
> +static svn_error_t *
> +print_log_details(void *baton,
> +                  svn_log_entry_t *log_entry,
> +                  apr_pool_t *pool)

Could we use the log receiver already present in log-cmd.c instead?  If not, why not?

- Julian

> +{
> +  const char *author;
> +  const char *date;
> +  const char *message;
> +
> +  svn_compat_log_revprops_out(&author, &date, &message, log_entry->revprops);
> +
> +  if (author == NULL)
> +    author = _("(no author)");
> +
> +  if (date && date[0])
> +    /* Convert date to a format for humans. */
> +    SVN_ERR(svn_cl__time_cstring_to_human_cstring(&date, date, pool));
> +  else
> +    date = _("(no date)");
> +
> +  if (log_entry->non_inheritable)
> +    SVN_ERR(svn_cmdline_printf(pool,
> +                              SEP_STRING "r%ld* | %s | %s",
> +                              log_entry->revision, author, date));
> +  else
> +    SVN_ERR(svn_cmdline_printf(pool,
> +                              SEP_STRING "r%ld | %s | %s",
> +                              log_entry->revision, author, date));
> +
> +  if (message != NULL)
> +    {
> +      /* Number of lines in the msg. */
> +      int lines = svn_cstring_count_newlines(message) + 1;
> +
> +      SVN_ERR(svn_cmdline_printf(pool,
> +                                Q_(" | %d line", " | %d lines", lines),
> +                                lines));
> +    }
> +
> +  SVN_ERR(svn_cmdline_printf(pool, "\n"));
> +
> +  if (message != NULL)
> +    {
> +      /* A blank line always precedes the log message. */
> +      SVN_ERR(svn_cmdline_printf(pool, "\n%s\n", message));
> +    }
> +
> +  return SVN_NO_ERROR;
> +}
[...]
Received on 2013-06-12 18:21:53 CEST

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.