You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by SteveKing <st...@gmx.ch> on 2005/04/27 16:12:37 UTC

Find out the version of the repository server

Hi,

First a little background why I need to find out the version of the 
repository server. Maybe you guys know another way to do what I want 
without knowing the version?

Subversion 1.2 introduces svn_client_log2() which takes a 'limit' 
parameter. That's great. But, if you call that function with a < 1.2 
server, the server returns *all* revisions and the client just drops the 
ones not asked for. That can be *very* slow for many revisions.
So, I'd like to somehow check if the 'limit' option works as it does 
with 1.2 servers and if not, just use svn_client_log2() without the 
limit param. To limit the revisions fetched, I could then adjust the 
revision range accordingly.

Sure, I could always adjust the revision range to avoid the problems 
with < 1.2 servers, but then I might not get any log messages back if in 
the range I specify no changes to that path/URL happened - that's why 
I'd like to use the 'limit' param if possible.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Find out the version of the repository server

Posted by "C. Michael Pilato" <cm...@collab.net>.
Ben Reser <be...@reser.org> writes:

> On Wed, Apr 27, 2005 at 06:12:37PM +0200, SteveKing wrote:
> > First a little background why I need to find out the version of the 
> > repository server. Maybe you guys know another way to do what I want 
> > without knowing the version?
> > 
> > Subversion 1.2 introduces svn_client_log2() which takes a 'limit' 
> > parameter. That's great. But, if you call that function with a < 1.2 
> > server, the server returns *all* revisions and the client just drops the 
> > ones not asked for. That can be *very* slow for many revisions.
> > So, I'd like to somehow check if the 'limit' option works as it does 
> > with 1.2 servers and if not, just use svn_client_log2() without the 
> > limit param. To limit the revisions fetched, I could then adjust the 
> > revision range accordingly.
> > 
> > Sure, I could always adjust the revision range to avoid the problems 
> > with < 1.2 servers, but then I might not get any log messages back if in 
> > the range I specify no changes to that path/URL happened - that's why 
> > I'd like to use the 'limit' param if possible.
> 
> I'm pretty sure someone has pointed this out to you before but why don't
> you just use svn_ra_get_latest_revnum?

Er.  He doesn't want to know what the HEAD revision in a repository
is.  He wants to know if the server is running Subversion 1.2 codebase
or better.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Find out the version of the repository server

Posted by Mark Phippard <Ma...@softlanding.com>.
Ben Reser <be...@reser.org> wrote on 04/27/2005 01:51:22 PM:

> On Wed, Apr 27, 2005 at 06:12:37PM +0200, SteveKing wrote:
> > First a little background why I need to find out the version of the 
> > repository server. Maybe you guys know another way to do what I want 
> > without knowing the version?
> > 
> > Subversion 1.2 introduces svn_client_log2() which takes a 'limit' 
> > parameter. That's great. But, if you call that function with a < 1.2 
> > server, the server returns *all* revisions and the client just drops 
the 
> > ones not asked for. That can be *very* slow for many revisions.
> > So, I'd like to somehow check if the 'limit' option works as it does 
> > with 1.2 servers and if not, just use svn_client_log2() without the 
> > limit param. To limit the revisions fetched, I could then adjust the 
> > revision range accordingly.
> > 
> > Sure, I could always adjust the revision range to avoid the problems 
> > with < 1.2 servers, but then I might not get any log messages back if 
in 
> > the range I specify no changes to that path/URL happened - that's why 
> > I'd like to use the 'limit' param if possible.
> 
> I'm pretty sure someone has pointed this out to you before but why don't
> you just use svn_ra_get_latest_revnum?

Isn't that just going to give him the latest revision number?  How is that 
going to help?  The issue is that he wants to support the new feature of 
just showing the last N log messsages.  This improves performance and 
usability of the log viewer, especially since you typically care more 
about recent log messages.  His UI allows you to go get more messages if 
needed.

The way this worked prior to 1.2 is that he would get the latest revision 
X and then retrieve the messages between X and X - 100.  This was fast, 
but it might only give you 1 message and then the only option was to go 
get the rest.  Where as now he can show you the last 100 revisions, the 
next 100 etc...

The problem is that when you use the new 1.2 feature against a 1.1 server 
it is very slow because the client is retrieving all of the messages and 
then filtering them to just give what you asked for.

What Stefan is asking for is a way to determine that he is talking to a 
1.1 server so that he can fall back to his old technique but still offer 
the great new feature for 1.2 users.

Mark

_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. by IBM Email Security Management Services powered by MessageLabs. 
_____________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Find out the version of the repository server

Posted by Ben Reser <be...@reser.org>.
On Wed, Apr 27, 2005 at 06:12:37PM +0200, SteveKing wrote:
> First a little background why I need to find out the version of the 
> repository server. Maybe you guys know another way to do what I want 
> without knowing the version?
> 
> Subversion 1.2 introduces svn_client_log2() which takes a 'limit' 
> parameter. That's great. But, if you call that function with a < 1.2 
> server, the server returns *all* revisions and the client just drops the 
> ones not asked for. That can be *very* slow for many revisions.
> So, I'd like to somehow check if the 'limit' option works as it does 
> with 1.2 servers and if not, just use svn_client_log2() without the 
> limit param. To limit the revisions fetched, I could then adjust the 
> revision range accordingly.
> 
> Sure, I could always adjust the revision range to avoid the problems 
> with < 1.2 servers, but then I might not get any log messages back if in 
> the range I specify no changes to that path/URL happened - that's why 
> I'd like to use the 'limit' param if possible.

I'm pretty sure someone has pointed this out to you before but why don't
you just use svn_ra_get_latest_revnum?

Sure you have to do the bother to setup an RA session but it's not any
harder to setup an RA session than it is a client ctx since the client
lib is using what you give it to setup the RA session.  

Probably could get away with leaving all of the function pointers in
svn_ra_callbacks_t set to NULL and only setting the auth_baton (which
you have to set for a client ctx too).  

If you've already got a ctx, you could just do something like this:

svn_error_t *my_client_get_latest_revnum (svn_client_ctx_t *ctx,
                                          const char *repos_URL,
                                          svn_revnum_t *latest_revnum,
                                          apr_pool_t *pool)
{
  svn_ra_session_t *ra_session;
  svn_ra_callbacks_t *ra_callbacks = ap_pcalloc (pool, sizeof(*ra_callbacks));
  ra_callbacks->auth_baton = ctx->auth_baton;

  SVN_ERR (svn_ra_open (&ra_session, repos_URL, ra_callbacks, NULL,
           ctx->config, pool);

  return svn_ra_get_latest_revnum (ra_session, latest_revnum, pool);
}

 
(Note that's untested and largely off the top of my head but it ought to
work.)
 
Then you don't have to worry about versions of the server nor getting
any extra data across the network that you don't really need.

-- 
Ben Reser <be...@reser.org>
http://ben.reser.org

"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org