Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 80514

Summary: [Operations] switching back to branch forgets added files
Product: [Eclipse Project] Platform Reporter: Rafael Chaves <eclipse>
Component: CVSAssignee: platform-cvs-inbox <platform-cvs-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Rafael Chaves CLA 2004-12-08 15:47:11 EST
i200412070800

Having created some new files in a branch, I merged back so I could release the
changes to HEAD. Later, I changed my mind, and wanted to continue working on the
branch instead. The files I added in the branch and that were now in my
workspace appear as additions, however they already exist in the branch. Steps I
performed:

1 - created a branch v20041204_NewPropertyStore for org.eclipse.core.resources
2 - added some new files to an existing directory
(src/org/eclipse/core/internal/properties/PropertyManager2.java, for instance)
3 - committed
4 - replaced org.eclipse.core.resources with the contents from HEAD
5 - merged the project in the workspace with the contents in the branch - I did
not release my local changes to HEAD
6 - wanted to continue working on the branch, so I switched back to the branch
(Team->Switch to branch or version...).
7 - Result: all files that did not exist in HEAD show up as additions when
synchronizing - they should not, since they exist in the branch
Comment 1 Jean-Michel Lemieux CLA 2004-12-09 10:20:28 EST
The "switch" operation doesn't touch new files, that is the power of it. The
next time you synchronize the "additions" should appear as conflicts. But any
new addition you added to your workspace while connected to HEAD, should also
still appear and allow you to commit to the branch. 

Switching allows making changes, going to another branch without loosing the
changes and committing. But we don't synchronize for free when the switch
occurs. This is raw CVS behavior.

Did you see the conflicts after synchronizing?
Comment 2 Michael Valenta CLA 2004-12-09 10:46:54 EST
The problem was that the files in question were added to version control 
before the switch but did not have a tag in the entry file. In the sync view, 
they appear as outgoing additions. Committing them put them in HEAD and not in 
the branch. The switch should have changed the tag on these files but did not. 
Also, there was no indication in the sync view that the files were on HEAD. 
Comment 3 Jean-Michel Lemieux CLA 2004-12-09 10:57:11 EST
If they are added to HEAD before the switch... good luck :) So the switch
doesn't change the tags on only added files. 
Comment 4 Michael Valenta CLA 2006-06-19 15:40:25 EDT

*** This bug has been marked as a duplicate of 121433 ***