You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bert Wesarg <be...@googlemail.com> on 2011/02/09 21:21:50 UTC

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

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

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

Posted by Bert Wesarg <be...@googlemail.com>.
On Thu, Feb 10, 2011 at 10:58, Philip Martin <ph...@wandisco.com> wrote:
> Bert Wesarg <be...@googlemail.com> writes:
>
>> 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
>
> I think this is fixed on trunk.  I get your results with 1.6 and with
> 1.7 I get:
>
> $ svnversion -c svn-wc.12027/
> 2:5
> $ svn st -v svn-wc.12027/
>                 6        5 pm           svn-wc.12027
>                 6        2 pm           svn-wc.12027/file
>                 6        5 pm           svn-wc.12027/dir
>                 6        5 pm           svn-wc.12027/dir/sub-file
>

Good new, and thanks for looking into this.

Bert

>
> --
> Philip
>

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

Posted by Philip Martin <ph...@wandisco.com>.
"C. Michael Pilato" <cm...@collab.net> writes:

> On 02/10/2011 04:58 AM, Philip Martin wrote:
>> I think this is fixed on trunk.  I get your results with 1.6 and with
>> 1.7 I get:
>> 
>> $ svnversion -c svn-wc.12027/
>> 2:5
>> $ svn st -v svn-wc.12027/
>>                  6        5 pm           svn-wc.12027
>>                  6        2 pm           svn-wc.12027/file
>>                  6        5 pm           svn-wc.12027/dir
>>                  6        5 pm           svn-wc.12027/dir/sub-file
>
> Philip, is this related in any way to issue #3676?
> http://subversion.tigris.org/issues/show_bug.cgi?id=3676

I thought I remembered as issue!  Yes, wcng appears to fix it.

-- 
Philip

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

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 02/10/2011 04:58 AM, Philip Martin wrote:
> I think this is fixed on trunk.  I get your results with 1.6 and with
> 1.7 I get:
> 
> $ svnversion -c svn-wc.12027/
> 2:5
> $ svn st -v svn-wc.12027/
>                  6        5 pm           svn-wc.12027
>                  6        2 pm           svn-wc.12027/file
>                  6        5 pm           svn-wc.12027/dir
>                  6        5 pm           svn-wc.12027/dir/sub-file

Philip, is this related in any way to issue #3676?
http://subversion.tigris.org/issues/show_bug.cgi?id=3676

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


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

Posted by Philip Martin <ph...@wandisco.com>.
Bert Wesarg <be...@googlemail.com> writes:

> 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

I think this is fixed on trunk.  I get your results with 1.6 and with
1.7 I get:

$ svnversion -c svn-wc.12027/
2:5
$ svn st -v svn-wc.12027/
                 6        5 pm           svn-wc.12027
                 6        2 pm           svn-wc.12027/file
                 6        5 pm           svn-wc.12027/dir
                 6        5 pm           svn-wc.12027/dir/sub-file


-- 
Philip