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

[PATCH] Re: log/blame -g and old servers

From: David Glasser <glasser_at_davidglasser.net>
Date: 2007-10-13 00:31:03 CEST

On 10/12/07, David Glasser <glasser@davidglasser.net> wrote:
> It looks like running "svn log -g" against an old server just silently
> acts as if the -g isn't there. (Maybe the same is true for blame as
> well?) Is this OK? I think this should be an error, so that the user
> knows that the requested info isn't there. (Sure, you wouldn't expect
> there to be mergeinfo for an old server, but one can imagine
> situations where an old server is being run against a repository that
> used to have a 1.5 server on it...)

Here's a patch implementing that for ra_svn. (Presumably, the same
patch for DAV will be harder because of the general lack of
capabilities.)

--dave

Index: subversion/libsvn_ra_svn/client.c
===================================================================
--- subversion/libsvn_ra_svn/client.c (revision 27161)
+++ subversion/libsvn_ra_svn/client.c (working copy)
@@ -1229,6 +1229,11 @@ static svn_error_t *ra_svn_log(svn_ra_se
   svn_boolean_t want_custom_revprops;
   apr_uint64_t revprop_count;

+ if (include_merged_revisions &&
+ !svn_ra_svn_has_capability(conn, SVN_RA_SVN_CAP_MERGEINFO))
+ return svn_error_create(SVN_ERR_RA_SVN_BAD_VERSION, NULL,
+ _("Server does not support merge-sensitive log"));
+
   SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "w((!", "log"));
   if (paths)
     {
@@ -1550,6 +1555,11 @@ static svn_error_t *ra_svn_get_file_revs
   apr_uint64_t merged_rev_param;
   svn_boolean_t merged_rev;

+ if (include_merged_revisions &&
+ !svn_ra_svn_has_capability(sess_baton->conn, SVN_RA_SVN_CAP_MERGEINFO))
+ return svn_error_create(SVN_ERR_RA_SVN_BAD_VERSION, NULL,
+ _("Server does not support
merge-sensitive blame"));
+
   /* One sub-pool for each revision and one for each txdelta chunk.
      Note that the rev_pool must live during the following txdelta. */
   rev_pool = svn_pool_create(pool);

-- 
David Glasser | glasser_at_davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 13 00:31:14 2007

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.