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

svn info and svnversion show wrong last committed revision when switching branches.

From: Bert Wesarg <bert.wesarg_at_googlemail.com>
Date: Wed, 9 Feb 2011 21:21:50 +0100

Hi,

I have svn version 1.6.12 (r955767) here.

Creating a new file in a subdirectory in ^/trunk, than merging this
^/trunk into a branch and switching back to ^/trunk, still shows me as
the last changed revision of this file in ^/trunk the merge revision
of the branch. The last changed revision for ^/trunk is that prior the
merge. When modifying the file in the branch than switching back to
^/trunk again, than I will see as the last changed revision the
revision prior the merge for the file.

Below is a recipe:

svnroot=$PWD/svn-root.$$
echo svnroot=$svnroot
mkdir -p $svnroot
svnadmin create $svnroot
svnroot=file://$svnroot
svnwc=svn-wc.$$
echo svnwc=$svnwc
svn co $svnroot $svnwc
cd $svnwc
svn mkdir trunk branches tags
svn ci -m "-s"
svn up
cd ..
rm -rf $svnwc
svn co $svnroot/trunk $svnwc
cd $svnwc
echo foo >>file
svn add file
svn ci -m "adding foo"
svn up
svn cp ^/trunk ^/branches/branch -m "branching"
svn switch ^/branches/branch
echo bar >>file
svn ci -m "bar"
svn up
svnversion
# 4
svnversion -c
# 4
svn info
# Revision: 4
# Last Changed Rev: 4
svn switch ^/trunk
svn up
svnversion
# 4
svnversion -c
# 2
svn info
# Revision: 4
# Last Changed Rev: 2
svn mkdir dir
echo FOO >>dir/sub-file
svn add dir/sub-file
svn ci -m "new stuff"
svn up
svn switch ^/branches/branch
svn up
svn merge ^/trunk
svn ci -m "merging"
svn up
svnversion
# 6
svnversion -c
# 4:6
svn info
# Revision: 6
# Last Changed Rev: 6
svn switch ^/trunk
svn up

# here it starts to show the wrong revision.

svnversion
# 6
svnversion -c
# 2:6
svn info
# Revision: 6
# Last Changed Rev: 5
svn info dir/sub-file
# Revision: 6
# Last Changed Rev: 6
svn switch ^/branches/branch
echo BAR >>dir/sub-file
svn ci -m BAR
svn up
svn switch ^/trunk
svn up

# and here, all is fine again

svnversion
# 7
svnversion -c
# 2:5
svn info
# Revision: 7
# Last Changed Rev: 5

Thanks for looking into this.

Bert
Received on 2011-02-09 21:28:21 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.