Tuesday, September 20, 2011

Checking what files to checkin in SVN

Coming from rational Clearcase background, I always like to check which files I need to checkin and which files I would like to revert back.

First I check all files that have been added but not necessarily been added into the svn archive.
svn status | grep "^?" | awk '{ print $2} 

For the files that need to achieved do this manually.  For all other files you should save these in a tar and delete them. Most often these are files
svn status | grep "^?" | awk '{ print $2} >not-needed.txt

At this point you may want to remove the directories which are cached or not under source control

tar cxvfa  not-needed.tgz -T not-need.txt 
cat not-needed.txt | xarags rm -rf $1


Finally for all files that are now modified, I like to make sure they are really needed. Do a diff and make sure the code is correct.

svn status | grep "^[AM]" | awk '{if ($2=="S" || $2=="+") print $3; else print $2;}'



No comments:

Post a Comment