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

Re: [PATCH] - svn blame doesn't use the working revision ( Issue #1777 )

From: John Szakmeister <john_at_szakmeister.net>
Date: 2004-04-20 02:15:26 CEST

Committed in r9440 with a couple minor changes. I have some comments below
for future patches. :-) Thanks for the patch!

-John

On Monday 19 April 2004 00:46, S.Ramaswamy wrote:
> John Szakmeister, Mike, Karl - Thanks.
>
> The revised patch:
>
> Log Message:
> Fix Issue #1777: 'svn blame' should default to the working revision,
> when no revision is specified.
>
> * subversion/clients/cmdline/blame-cmd.c
> (svn_cl__blame) : Set end revision to svn_opt_revision_base if
> the target is a working copy, and to svn_opt_revision_head if
> the target is a URL.
>
> Index: subversion/clients/cmdline/blame-cmd.c
> ===================================================================
> --- subversion/clients/cmdline/blame-cmd.c (revision 9374)
> +++ subversion/clients/cmdline/blame-cmd.c (working copy)
> @@ -85,6 +85,8 @@
> svn_stream_t *out;
> blame_baton_t bl;
> int i;
> + svn_boolean_t is_head_or_base = FALSE;
> + svn_boolean_t is_url;
>
> SVN_ERR (svn_opt_args_to_target_array (&targets, os,
> opt_state->targets,
> @@ -108,7 +110,9 @@
> opt_state->start_revision.value.number = 1;
> }
> else
> - opt_state->end_revision.kind = svn_opt_revision_head;
> + {
> + is_head_or_base = TRUE;
> + }

No need for the extra braces here.

> }
>
> if (opt_state->start_revision.kind == svn_opt_revision_unspecified)
> @@ -129,6 +133,14 @@
> const char *target = ((const char **) (targets->elts))[i];
> svn_pool_clear (subpool);
> SVN_ERR (svn_cl__check_cancel (ctx->cancel_baton));
> + if (is_head_or_base)
> + {
> + is_url = svn_path_is_url(target);

There is also no need to have another variable to hold the result of the path
check. This is a pretty simple operation, and the result doesn't get used
again anywhere else.

> + if (is_url)
> + opt_state->end_revision.kind = svn_opt_revision_head;
> + else
> + opt_state->end_revision.kind = svn_opt_revision_base;
> + }

The indentation was a little off here. We generally only use 2 spaces for the
indentation.

> err = svn_client_blame (target,
> &opt_state->start_revision,
> &opt_state->end_revision,
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Apr 20 02:18:56 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.