How to branch CVS after edits?
I'm struggling to get a hang of branching in CVS after reading the documentation & tutorials online. Let me give you an example of how my dev flow sometimes works:
I'll make a few changes on something (let's say fix some bug that not surprisingly turns into a larger project/activity). Now, I don't want to commit these changes to the main branch because they will be releas开发者_开发问答ed if someone does an Update on the webserver.
I looked up branching, but if I try and branch these files then it says I can't because the files have been modified. Am I going about this the wrong way? Up until now I've just left these changes stewing in my local sandbox, but this can get tricky with multiple overlapping projects/bug fixes (some of which are quick and need to be released before the changes mentioned above).
This can be readily accomplished by unticking Check that files are unmodified on the Branch Creation dialogue box.
Once the branch is created, switch to the branch by doing an Update Special and choosing the new branch (you may need to click Update list... for the new branch to appear). The locally-modified files will be unaffected by this update (provided that you do not tick Clean copy). Then simply do a Commit as normal to make your changes appear in the new branch.
It was effectively impossible to make this task work. Having finally implemented Git, I have been given wings and no longer do I have to trudge through the mud of CVS. Case closed ... do not attempt branching with CVS (especially after changes).
Haven't worked with cvs for ten years or so ;)
I think you have to update your working-copy first. This will merge all changes from the main-branch into your working-copy. If this doesn't help just do a fresh checkout into a different directory, branch away and copy your changes into the new workingcopy (but be careful, if someone else changed something in those files, you are overwriting his changes).
its absolutely possible to do this, in fact it was one of the design principle of cvs to be able to do this.
http://cedric.babault.free.fr/TortoiseCVSDoc/UserGuide_en.html#advanced.branching
This is actually not terribly difficult to do:
- Copy your root cvs directory to a new location
- Wipe and re-checkout the root from cvs
- Branch
- Update to branch
- Copy the files you've added or changed from the copy back to the main root directory
- Add Content
- Commit
- Enjoy
Edit: it's worth noting that in step 5, be sure NOT to copy any "CVS" folders back
精彩评论