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;
+ }
}
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);
+ if (is_url)
+ opt_state->end_revision.kind = svn_opt_revision_head;
+ else
+ opt_state->end_revision.kind = svn_opt_revision_base;
+ }
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
Received on Mon Apr 19 06:52:18 2004