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

Re: Way to get current revision as keyword...?

From: Max Bowsher <maxb_at_ukf.net>
Date: 2004-12-04 20:01:08 CET

Theo Van Dinter wrote:
> On Sat, Dec 04, 2004 at 05:59:10PM -0000, Max Bowsher wrote:
>> But what about when the entire WC is not at a single revision?
>
> Hrm. In thinking about the response, I do see where the issues may get
> a bit tricky.
>
> Here's my thinking about this question:
>
> - Checkout revision 100. Substitute "100" for all files.
> - Changes occur remotely, up to revision 103.
> - Make updates locally and commit, those files get revision 104.
> Subtitute "104" for all files which were committed.
> - "svn update" to pull in remote changes. Substitute "104" for all files.
>
>> Or, if you "svn update" only parts of a working copy?
>
> You would only update substitutions where appropriate. So:
>
> - Checkout revision 100. Substitute "100" for all files.
> - Changes occur remotely in directories "a", "b", and "c", up to
> revision 103.
> - "svn update" in directory "a". Substitute "103" for all files in "a".
>
>> And what about local modifications? svnversion will tell you about them,
>> but
>> there's no way a keyword could do that.
>
> From what I can tell, keywords aren't updated for local modifications,
> so I don't expect that to change.

As you can see, there are a large amount of edge cases which can be bypassed
by using the `svnversion` method, rather than a keyword - which is why this
design was chosed in the first place.

The script/Makefile technique is universally applicable, as far as we know,
and whilst that is true, it seems counter-productive to spend time writing
an alternative implementation which is intrinsically less powerful and more
complicated.

You mentioned a difficulty when exporting - it may be solved as follows:

$ head=`svn log -q -r HEAD $repos_base_url | sed -ne
's/^r\([0-9]*\).*$/\1/p'`
$ svn export -r $head $my_project_url my-project
$ echo $head > my-project/revision

Or indeed, pipe the output of "svn export" through some filter, and read the
revision out of its last line.

I suppose an argument can be made that this is not so nice for
scripting-challenged platforms like Windows.

I think, though, that you will have an easier time gaining support for a
nicer way for export to communicate what revision it exported, than gaining
support for a $SvnVersionAlike$ keyword.

Max.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Dec 4 20:03:34 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.