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

Re: Getting HEAD revision number from a URL

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2004-10-24 15:50:49 CEST

On Oct 23, 2004, at 7:57 PM, Scott Palmer wrote:
>
>
> Why is there no simple way to query the repository for the head
> revision?

Because it's not a common operation? 'svn log' tells you. So does
'svn up'. Does does 'svn st -u'. Most of the time people are working
with working copies, not with abstract URLs.

Nevertheless, there *is* a network API call for this in svn_ra.h. Just
run RA->get_latest_revnum(). It's just not been isolated as a single
command.

But here's a special present for you. It took me 1 minute to modify
from tools/examples/svnput.c.

[sussman@BenBook:~/projects/svn/tools/examples]$ cc headrev.c -o
headrev -g -I/usr/local/include/subversion-1
-I/usr/local/apache2/include -L/usr/local/apache2/lib -L/usr/local/lib
-lsvn_client-1 -lsvn_ra-1 -lsvn_subr-1 -lapr-0 -laprutil-0

[sussman@BenBook:~/projects/svn/tools/examples]$ ./headrev
http://svn.collab.net/repos/svn

The latest revision is 11610.

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

Received on Sun Oct 24 15:51:14 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.