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

$Rev$ expanded differently in two up-to-date checkouts?!

From: Manuel Pégourié-Gonnard <mpg_at_elzevir.fr>
Date: Fri, 11 Jun 2010 16:09:12 +0200

Hi,

Consider the following scenario: someone copies a directory, then commit. Inside
this directory, there are a few files with the $Rev$ keyword set to be expanded.
Another user updates his working copy to the same revision. Both look at the
expansion of the $Rev$ keyword in the files: they are not the same.

I'm quite surprised, since I would have expected this to be independent of the
working copy used (as long as it's up-to-date, obviously).

Example (current working directory printed before shell prompt):

$ svnadmin create repo
$ svn co file://$PWD/repo active
Checked out revision 0.
$ svn co file://$PWD/repo passive
Checked out revision 0.
$ cd active
(active) $ svn mkdir dir
A dir
(active) $ echo '$Rev$' > dir/file; svn add dir/file
A dir/file
(active) $ svn propset svn:keywords Rev dir/file
property 'svn:keywords' set on 'dir/file'
(active) $ svn ci -mdummy
Adding dir
Adding dir/file
Transmitting file data .
Committed revision 1.
(active) $ svn cp dir newdir
A newdir
(active) $ svn ci -mdummy
Adding newdir

Committed revision 2.
(active) $ head -v */file
==> dir/file <==
$Rev: 1 $

==> newdir/file <==
$Rev: 2 $
(active) $ cd ../passive
(passive) $ svn up
A newdir
A newdir/file
A dir
A dir/file
Updated to revision 2.
(passive) $ head -v */file
==> dir/file <==
$Rev: 1 $

==> newdir/file <==
$Rev: 1 $
(passive) $

Now, another funny point: in the "active" working copy, do "svn up -r1; svn up"
and then you've got the same keyword expansion as in the "passive" copy.

I'm a bit annoyed, because:
1. I don't understand why it works this way.
2. I have some scripts relying on the value of the expanded Rev keyword (or,
equivalently, the 3rd field in the output of svn status -v), and I'd like them
to give the same result in all up-to-date checkouts.

Can someone please enlighten me? Thanks in advance.

Manuel.
Received on 2010-06-11 16:09:51 CEST

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.