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

Re: Getting the current repository version

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-05-10 11:45:22 CEST

On May 10, 2007, at 04:29, Mike Quilleash wrote:

> I want to be able to detect if a local copy is older than the
> respository. Closest thing I can find to do this is:
>
> svn -q -r HEAD log svn://xxx/trunk
>
> Which prints out the repo revision of the head, but i'm not
> sure if this works for branches.

Branches are nothing special. The HEAD of the repository is the HEAD
of the repository, regardless what URL you use to ask for it.

You could also use "svn info" to get this information:

$ svn info svn://xxx/whatever | awk '/^Revision:/ {print $2}'

> Just being able to get the latest revision of a repository URL would
> be fine as I can get the local revision with 'svn info'

Be aware that "svn info" on a local working copy will only tell you
about the exact object on which you asked for the info. For example,
if you run "svn info" at the root of your working copy and it's,
let's say, 42, there's no guarantee that the files or directories
inside that directory are also at that revision. So it's better to
use "svnversion" instead of "svn info" for this. It might print
something like "39:42" which tells you the low and high revision
numbers across the entire working copy.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu May 10 11:45:53 2007

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.