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

Re: getting a repository's latest revision

From: Christopher Ness <chris_at_nesser.org>
Date: 2004-10-11 05:12:16 CEST

On Sun, 2004-10-10 at 22:51, Rob Hills wrote:
> Hi All,
>
> I use ant scripts to build our applications for release. As part of this process, source
> code is exported from the repository to a temporary directory and built.
>
> In my ant script, this process often involves getting files from several different areas of
> our repository and hence involves several "export" operations. To ensure I get a
> consistent build, I use the same revision number for all my exports.
>
> However, I've not been able to find any way of getting the "latest" revision number of
> a repository without at least exporting one file from it. I've looked at the "svn info"
> command, but this operates against a working copy which won't necessarily be
> present on the build machine. So, for now, I do an export, parse its output for the
> revision number and then use that revision number for subsequent exports. It works,
> but I find it a bit messy and it is of course subject to any changes in the formatting of
> the output from the export command.
>
> I guess what I'm looking for is a kind of "svn revision URL" command that returns the
> latest revision of the specified url without needing a local client working copy.
> Alternatively perhaps, allow the "svn status" command to take a URL instead of a
> local path and then return appropriate values for that URL.

Why not just check out all the projects at once by making a list of them
in the arguments.

  svn co -r "HEAD" http://websvn.your.domain/trunk/proj1 \
  http://websvn.your.domain/trunk/proj2 etc.....

I'm not sure if this will check out the same version of "HEAD" if
someone checks in a change to a project during the checkout command's
runtime. Maybe someone else can clear that up if svn's commands are
atomic.

If "HEAD" can change during your check out. You could check out one
project, find the repository version number using Steve Williams method
or the `svnversion` program and then check out the rest of the projects
using that as the -r argument.

I think that should do it.
Cheers,
Chris

-- 
Software Engineering IV,
McMaster University
PGP Public Key: http://www.nesser.org/pgp-key/
22:56:29 up 6 min, 2 users, load average: 0.07, 0.41, 0.24 
http://www.fsf.org/philosophy/no-word-attachments.html

Received on Mon Oct 11 05:12: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.