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

Re: svn commit: r952205 - /subversion/trunk/subversion/libsvn_client/diff.c

From: Stefan Sperling <stsp_at_elego.de>
Date: Mon, 7 Jun 2010 15:33:16 +0200

On Mon, Jun 07, 2010 at 12:43:19PM -0000, dannas_at_apache.org wrote:
> Author: dannas
> Date: Mon Jun 7 12:43:19 2010
> New Revision: 952205
>
> URL: http://svn.apache.org/viewvc?rev=952205&view=rev
> Log:
> Use several smaller functions for printing git diff headers instead of one.
>
> * subversion/libsvn_client/diff.c
> (print_git_diff_header): Split this one into ...
> (print_git_diff_header_added): ..this ...
> (print_git_diff_header_deleted): .. and this ...
> (print_git_diff_header_copied): .. and this ...
> (print_git_diff_header_moved): .. and this ...
> (print_git_diff_header_modified): .. and this.
> (diff_content_changed): Adjust caller.
>
> Modified:
> subversion/trunk/subversion/libsvn_client/diff.c

> +/*
> + * Print a git diff header for PATH to the stream OS using HEADER_ENCODING.
> + * COPYFROM_PATH is the origin of the operation. All allocations are done
> + * in RESULT_POOL. */
> +static svn_error_t *
> +print_git_diff_header_copied(svn_stream_t *os, const char *header_encoding,
> + const char *path, const char *copyfrom_path,
> + apr_pool_t *result_pool)
> +{
> + SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
> + "diff --git a/%s b/%s%s",
> + copyfrom_path, path, APR_EOL_STR));
> + SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
> + "copy from %s%s", path, APR_EOL_STR));
                                               ^^^^ ^^^^^
> + SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
> + "copy to %s%s", copyfrom_path,
                                              ^^^ ^^^^
> + APR_EOL_STR));

Shouldn't the copyfrom_path be printed for copy from, and the path for
copy to?

> + return SVN_NO_ERROR;
> +}
> +
> +/*
> + * Print a git diff header for PATH to the stream OS using HEADER_ENCODING.
> + * COPYFROM_PATH is the origin of the operation. All allocations are done
> + * in RESULT_POOL. */
> +static svn_error_t *
> +print_git_diff_header_moved(svn_stream_t *os, const char *header_encoding,
> + const char *path, const char *copyfrom_path,
> + apr_pool_t *result_pool)
> +{
> + SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
> + "diff --git a/%s b/%s%s",
> + copyfrom_path, path, APR_EOL_STR));
> + SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
> + "rename from %s%s", path,
> + APR_EOL_STR));
> + SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
> + "rename to %s%s", copyfrom_path,
> + APR_EOL_STR));

Same here.

Stefan
Received on 2010-06-07 15:34:05 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.