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

Re: Why does `svnversion -c` give me a range?

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Wed, 4 Dec 2013 18:07:52 +0200

Ryan Schmidt wrote on Wed, Dec 04, 2013 at 06:14:33 -0600:
>
> On Dec 4, 2013, at 06:00, Cooke, Mark wrote:
>
> > I would like to include the svn revision number in my project's version info but I am confused by the results of svnversion. I want the version number of a tagged tree to always be the same (i.e. the last commit to the tag) but if the tag is to be rebuilt using a fresh checkout some time later `svnversion` seems to report the HEAD revision. So I looked at `svnversion -c` but this always seems to give me a range e.g. `2:1476`, even directly after an update.
> >
> > I have read the red book but it is quite vague about the -c option. Why is `-c` always giving me a range?
>
> I think the `-c` option means: given all the item in this directory and recursive subdirectories, give the oldest and newest changed file. So, the oldest item in your working copy was last changed in revision 2, and the newest was last changed in revision 1476.
>
> And `svnversion` without any flag does seem to give the latest
> revision to which the working copy was updated, not the last changed
> revision.
>

Note that "bare" svnversion can give a range as well:

    % svnversion -c ~srv/conf
    105:143
    % svnversion ~srv/conf
    142:143

FWIW, all this should be documented in 'svnversion --help'. Is it clear
there?

> If you want the last changed revision, you could use:
>
> svn info | sed -n 's/^Last Changed Rev: //p'
>
>
>
Received on 2013-12-04 17:08:29 CET

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.