Monday, January 21, 2013

Revert a change in CVS

http://stackoverflow.com/questions/435368/how-do-i-revert-a-big-change-in-cvs

mkdir code_base1 && cd code_base1  cvs co -D "2008-12-30" modulename  cvs tag code_base_2008_12_30  

Now do the join tag-based, subtracting all changes between now and 2008-12-30:

cd .. && mkdir code_base2 && cd code_base2  cvs co modulename  cvs update -d -j HEAD -j code_base_2008_12_30  # use -d to resurrect deleted directories  

Compare the contents of code_base1 and code_base2. They should be identical except for the CVS meta information. Finally commit the code as it was on 2008-12-30 as new HEAD:

cvs commit -m "Revert all changes this year"  

Note that tagging the code you wish to join like this will not work, because rtag also does not handle removed files and directories correctly, when using -D:

No comments: