Community
Participate
Working Groups
Build ID: I20070517-1700 Steps To Reproduce: 1. add file a.txt to a project 2. share the project in CVS 3. create new CVS branch of the project: "branchX" 4. create another CVS branch of the project: "branchY" 5. switch to branchX 6. rename file a.txt to b.txt 7. commit the change 8. switch to branchY PROBLEM: a.txt is gone. More information:
I'm not able to reproduce that following the steps you provided. Have you tried selecting the project, clicking "Replace with> Another branch or version" and then selecting the "branchY" branch? It does work for me - b.txt from branchX is gone but the a.txt reappears.
I was trying to reproduce the problem using N20071010-0010 and 3.3. In both cases I couldn't reproduce it. Can you see the issue using 3.3?
Yes, I can reproduce the problem using: Version: 3.3.0 Build id: I20070517-1700.
To clarify steps further: Steps To Reproduce: 1. add file a.txt to a project P1. 2. share the project in CVS 3. create new CVS branch of the project: "branchX". Branching is done from project's HEAD. 4. create another CVS branch of the project: "branchY". Branching is done from project's HEAD. 5. switch to branchX (right click on project P1 and select "Team | Switch to Another Branch or Version...") 6. rename file a.txt to b.txt 7. commit the change 8. switch to branchY (right click on project P1 and select "Team | Switch to Another Branch or Version...") PROBLEM: a.txt is gone from project P1. I.e. both Project Explorer and Navigator views don't show a.txt file.
What version of CVS server are you using? Can you see anything odd in the Error log? If not, please turn the "Display detailed protocol output to stdout"[1] option to on and then check the Console view. [1] Team > CVS > General tab > Display detailed protocol output to stdout (for debugging)
Log for step #7: *** cvs add -kkv "/bug205882/b.txt" cvs add: file `b.txt' will be added on branch `branchX' from version 1.1.2.2 cvs add: use 'cvs commit' to add this file permanently ok (took 0:00.266) Error: The following warnings were reported while performing the "cvs add" command. Error: bug205882: cvs add: file `b.txt' will be added on branch `branchX' from version 1.1.2.2 *** *** cvs ci -m "10112007 verify bugzilla 205882" -l "/bug205882/b.txt" Checking in b.txt; /cvsroot/centaur/dubauski/defects_temp/bug205882/Attic/b.txt,v <-- b.txt new revision: 1.1.2.3; previous revision: 1.1.2.2 done Mailing centaur-commits@cs.opensource.ibm.com... Generating notification message... Generating notification message... done. ok (took 0:03.562) *** Log for step #8: *** cvs update -r "branchY" -d -P "/bug205882" cvs update: Updating . R a.txt cvs update: b.txt is no longer in the repository ok (took 0:00.453) ***
Regarding to CVS server version question. How do I get this information?
On the other hand the CVS server I'm using is: cvs.cs.opensource.ibm.com.
This looks related to bug 121433 and bug 80514. Tomek, if you are able to reproduce this problem using the provided steps, it may indicate that there is a problem in the underlying CVS operation. If you are able to reproduce it, you should probably trace the responses received from the server to see if that is the source of the problem (i.e. the responses from the switch operation).
I will have a second look at it during 3.4.1.
Pawel, could you give me a helping hand here?
Build id: I20080724-1200 I managed to reproduce the problem with the steps provided by Barys in the first comment. It's a bit tricky since you have to commit a change by clicking on the renamed file. If you do so only b.txt gets uploaded into the repository and a.txt is not removed: cvs ci -m "Renaming a.txt to b.txt" -l "/205882/src/b.txt" RCS file: /TEST/205882/src/b.txt,v done Checking in src/b.txt; /TEST/205882/src/b.txt,v <-- b.txt new revision: 1.1.2.1; previous revision: 1.1 done ok (took 0:00.125) Compare it with the following output if you commit by clicking on a parent directory or the whole project: cvs ci -m "Renaming a.txt to b.txt" -l "/205882/src/a.txt" "/205882/src/b.txt" Removing src/a.txt; /TEST/205882/src/a.txt,v <-- a.txt new revision: delete; previous revision: 1.1.2 done RCS file: /TEST/205882/src/b.txt,v done Checking in src/b.txt; /TEST/205882/src/b.txt,v <-- b.txt new revision: 1.1.2.1; previous revision: 1.1 done ok (took 0:00.171) IMO committing the change on a file should remove the old one from CVS and add the new one.
I spent some time investigating the problem and it seems like the „missing files” behavior might be a proper one. This is because the nature of the command, it differs from “Replace with Another Branch or Version” in that uncommitted changes are not replaced but moved to the resources from selected tag. And this gives surprising results some time, like missing files or files appearing from nowhere (when an uncommitted change applies to a file that is not present in a branch you want to switch to). In case of file renaming it would be possible (don't know if feasible) to commit both removal of the old file and addition of the new one in the same CVS operation. IMO this has some sense since that’s probably what you want to do when committing a renamed file. But in general those situations are impossible to avoid without redefinition of the “Switch to…” operation. Guys, what do you think about this?
Barys, can you confirm that using the "Replace with Another Branch" operation works as expected in your case?
Replace with another branch works fine.
Barys, I checked the behavior of the "Switch to..." command in WinCVS and it works exactly in the same way. So I think the current behavior is OK. However if this might be confusing to some CVS users, maybe a dialog with a message should be shown. Barys, what do you think about it? Or should the bug simply be closed?
"Barys, I checked the behavior of the "Switch to..." command in WinCVS and it works exactly in the same way. So I think the current behavior is OK." : Pawel, I'm not following you here. "Switch to ..." and "Replace with..." used to be different (at least when I actively used them over a year ago). If you are seeing consistent correct behavior for both operations then close the defect, Otherwise for any "confusing" behavior showing a warning dialog will be very useful to avoid panic from user who may think that he just lost his sources. Thank you, Barys
(In reply to comment #17) > "Barys, I checked the behavior of the "Switch to..." command in WinCVS and > it works exactly in the same way. So I think the current behavior is > OK." : Pawel, I'm not following you here. "Switch to ..." and > "Replace with..." used to be different (at least when I actively used them over > a year ago). I think, what Pawel meant to say was that the result of "Switch to..." command in Eclipse is exactly the same as the result of the same operation called in WinCVS (for the same input). The "Switch to..." and "Replace with..." commands from Eclipse are different (ie give different results in some cases).
Pawel is right that "Switch to.." works as expected. See "Workbench User Guide > Tasks > Working in the team environment with CVS". Team > Switch to Another Branch or Version - this update will replace Workbench resources with those on the tag specified in the Update dialog. The behavior differs from the above replace operations in that uncommitted modifications in the Workbench are not replaced but instead are "moved" to the resources from the selected tag. So the fact that a.txt is gone (the steps from comment 0) should not be confusing for users. I would close this as INVALID.
Barys, I'm closing the bug with resolution INVALID. Initially I thought about providing a message box to avoid confusion. However I dropped the idea since it would bring an additional dialog with purpose to warn about the plain operation of the “Switch to…” command.