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

[Subclipse-users] Re: Switching the branch of a subfolder does not take effect until the parent folder is manually updated.

From: John Shields <jshields_at_mechanicnet.com>
Date: 2007-03-10 20:32:49 CET

Sorry for replying to my own email, I forgot to subscribe to the list
before posting so I didn't get Mark's reply...

One important detail I forgot to mention is that I'm using the SVNKit
library. So the problem could certainly be in there, but nevertheless
the problem does occur in my environment as I described. Following is
the commit log from a contrived example I created. I've also included
the SVN console from eclipse. Note that there is some sort of problem
occurring as well.

The big thing to notice is the eclipse console output is the switch
command followed by the commit that creates r2462. Then if you look at
r2462 in the SVN log you can clearly see that it went to the "mainline".
Now the saving grace is that after the initial switch the GUI did NOT
update to reflect the switched status of the "child" folder. So the
result (committing to the "mainline") was consistent with the GUI (the
folder decorator indicated the folder was NOT switched). Likewise, if I
do the switch and then immediately perform an update on the "parent"
folder then the folder decorator does reflect the switch AND the commit
goes properly to the branch. So the GUI is properly reflecting the
behavior. Again, the problem is that I must do a manual update on the
parent folder to get the switch command to "take effect".

So my uninformed guess is that if a folder is switched relative to it's
parent folder, then the parent folder also needs an SVN update to get
the working copy into the proper state. This could very well be a bug in
SVNKit.

Thanks for the help!

Regards,
John

Eclipse console:

mkdir -m "" http://svn/svn/main/jmstest
    Committed revision 2455.
mkdir -m "" http://svn/svn/main/jmstest/mainline
    Committed revision 2456.
mkdir -m "" http://svn/svn/main/jmstest/branch
    Committed revision 2457.
mkdir -m "" http://svn/svn/main/jmstest/mainline/parent
    Committed revision 2458.
delete -m "" http://svn/svn/main/jmstest/mainline/parent
    Committed revision 2459.
checkout -r HEAD http://svn/svn/main/jmstest/mainline
    Checked out revision 2459.
add -N /home/jshields/workspace/jmstest/parent
    A /home/jshields/workspace/jmstest/parent
add -N /home/jshields/workspace/jmstest/parent/child
    A /home/jshields/workspace/jmstest/parent/child
add -N /home/jshields/workspace/jmstest/parent/child/child_file.txt
    A /home/jshields/workspace/jmstest/parent/child/child_file.txt
add -N /home/jshields/workspace/jmstest/base.txt
    A /home/jshields/workspace/jmstest/base.txt
add -N /home/jshields/workspace/jmstest/.project
    A /home/jshields/workspace/jmstest/.project
add -N /home/jshields/workspace/jmstest/parent/parent_file.txt
    A /home/jshields/workspace/jmstest/parent/parent_file.txt
commit -m "Adding initial test files."
/home/jshields/workspace/jmstest/.project
/home/jshields/workspace/jmstest/base.txt
/home/jshields/workspace/jmstest/parent
/home/jshields/workspace/jmstest/parent/parent_file.txt
/home/jshields/workspace/jmstest/parent/child
/home/jshields/workspace/jmstest/parent/child/child_file.txt
    Adding /home/jshields/workspace/jmstest/.project
    Adding /home/jshields/workspace/jmstest/base.txt
    Adding /home/jshields/workspace/jmstest/parent
    Adding /home/jshields/workspace/jmstest/parent/child
    Adding
/home/jshields/workspace/jmstest/parent/child/child_file.txt
    Adding /home/jshields/workspace/jmstest/parent/parent_file.txt
    Transmitting file data ...
    Committed revision 2460.
copy -rHEAD http://svn/svn/main/jmstest/mainline
http://svn/svn/main/jmstest/branch/branch1
    Committed revision 2461.
switch http://svn/svn/main/jmstest/branch/branch1/parent/child
/home/jshields/workspace/jmstest/parent/child -rHEAD
    At revision 2461.
commit -m "Commit should be on branch/branch1."
/home/jshields/workspace/jmstest/parent/child/child_file.txt
    Sending
/home/jshields/workspace/jmstest/parent/child/child_file.txt
    Transmitting file data ...
    Committed revision 2462.
update -r HEAD /home/jshields/workspace/jmstest/parent
    At revision 2462.
commit -m "Trying to commit the branch AFTER updating the parent."
/home/jshields/workspace/jmstest/parent/child/child_file.txt
    Sending
/home/jshields/workspace/jmstest/parent/child/child_file.txt
    svn: Commit failed (details follow):
    svn: Commit failed (details follow):
svn: The version resource does not correspond to the resource within the
transaction. Either the requested version resource is out of date
(needs to be updated), or the requested version resource is newer than
the transaction root (restart the commit).
svn: CHECKOUT of
'/svn/main/!svn/ver/2460/jmstest/mainline/parent/child/child_file.txt':
409 Conflict (http://svn/)
revert -N /home/jshields/workspace/jmstest/parent/child/child_file.txt
    Reverted /home/jshields/workspace/jmstest/parent/child/child_file.txt
switch http://svn/svn/main/mainline/branch1/parent/child
/home/jshields/workspace/jmstest/parent/child -rHEAD
    svn: Cannot replace a directory from within
svn: REPORT of '/svn/main/!svn/vcc/default': 500 Internal Server Error
(http://svn/)
switch http://svn/svn/main/jmstest/mainline/parent
/home/jshields/workspace/jmstest/parent -rHEAD
    U /home/jshields/workspace/jmstest/parent/child/child_file.txt
    Updated to revision 2462.
    ===== File Statistics: =====
    Updated: 1
switch http://svn/svn/main/jmstest/branch/branch1/parent/child
/home/jshields/workspace/jmstest/parent/child -rHEAD
    U /home/jshields/workspace/jmstest/parent/child/child_file.txt
    Updated to revision 2462.
    ===== File Statistics: =====
    Updated: 1
update -r HEAD /home/jshields/workspace/jmstest/parent
    At revision 2462.
commit -m "Trying to commit the branch AFTER updating the parent."
/home/jshields/workspace/jmstest/parent/child/child_file.txt
    Sending
/home/jshields/workspace/jmstest/parent/child/child_file.txt
    Transmitting file data ...
    Committed revision 2463.
update -r HEAD /home/jshields/workspace/jmstest/parent
    At revision 2463.

SVN log:

[jshields@jshields jmstest]$ svn log -v
------------------------------------------------------------------------
r2463 | jshields | 2007-03-10 11:03:11 -0800 (Sat, 10 Mar 2007) | 1 line
Changed paths:
   M /jmstest/branch/branch1/parent/child/child_file.txt

Trying to commit the branch AFTER updating the parent.
------------------------------------------------------------------------
r2462 | jshields | 2007-03-10 10:57:36 -0800 (Sat, 10 Mar 2007) | 1 line
Changed paths:
   M /jmstest/mainline/parent/child/child_file.txt

Commit should be on branch/branch1.
------------------------------------------------------------------------
r2461 | jshields | 2007-03-10 10:55:46 -0800 (Sat, 10 Mar 2007) | 1 line
Changed paths:
   A /jmstest/branch/branch1 (from /jmstest/mainline:2460)

Copying jmstest/mainline to branch/branch1
------------------------------------------------------------------------
r2460 | jshields | 2007-03-10 10:55:10 -0800 (Sat, 10 Mar 2007) | 1 line
Changed paths:
   A /jmstest/mainline/.project
   A /jmstest/mainline/base.txt
   A /jmstest/mainline/parent
   A /jmstest/mainline/parent/child
   A /jmstest/mainline/parent/child/child_file.txt
   A /jmstest/mainline/parent/parent_file.txt

Adding initial test files.
------------------------------------------------------------------------

John Shields wrote:
> Hello,
>
> I have found that when I switch the branch of a subfolder that the UI
> does not register the switch nor, more importantly, do commits go into
> the switched branch until I've updated the parent folder manually.
> What is interesting and troubling, though, is that the properties of
> the folder and of any files in the folder do reflect the switch. But
> again, commits don't seem to go to the switched branch.
>
> To reproduce:
>
> 1. Select a subfolder of a project and switch it to another branch.
> 2. Make a change to a file in that subfolder.
> 3. Commit the file.
> 4. Check the SVN repository directly to see where the commit "landed".
>
> In my tests, the change always goes to the original branch before the
> switch. However, if I follow these steps it works as expected:
>
> 1. Select a subfolder of a project and switch it to another branch.
> 2. Manually perform an "update" operation on the parent folder. (This
> causes the icon on the subfolder to reflect it's "switched" status.)
> 3. Make a change to a file in that subfolder.
> 4. Commit the file.
> 5. Check the SVN repository directly to see where the commit "landed".
>
> My environment:
>
> OS: CentOS 4.3 (RHEL)
> Eclipse: 3.2.2
> Subclipse: 1.2.0
> SVN protocol: http
> SVN Server: 1.2.3 w/ Apache 1.3
>
> Thanks!
>
> Regards,
> John
>
>
>

-- 
John M. Shields
Director of Engineering
MechanicNet Group, Inc.
Phone: 925-931-1983 x21
Email: jshields@mechanicnet.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subclipse.tigris.org
For additional commands, e-mail: users-help@subclipse.tigris.org
Received on Sat Mar 10 20:33:10 2007

This is an archived mail posted to the Subclipse Users mailing list.