Friday, November 13, 2009

checkout source code from CVS repository using date

The application is in production and there is no tag on production version source code in CVS.
We came across the same situation where we required to get the source code which has no tag in CVS.
Thank god we had the date and branch name on which production application was built.
The job was to get the source code from CVS using this build date.

In above scenario, there are various approaches to get this version but I would suggest the following one
There is a command which can do the job for you

cvs checkout -D$DATE -r$TAG $MODULE

To run this command you might need to set the property for CVSROOT, this will address the cvs repository loaction.
In linux you can set this in bashrc file as follows

export CVSROOT=$user@$cvs_server_repository_location

e.g. export CVSROOT=ganesh@100.200.300.400:/my/cvs/repository
example : cvs checkout -D3/31/92 10:00:07 PST -rMyBranchName MyModuleName

After setting the property you will be able to checkout from cvs

Following are the few of the valid date formats
1 month ago
2 hours ago
400000 seconds ago
last year
last Monday
yesterday
a fortnight ago
3/31/92 10:00:07 PST
January 23, 1987 10:05pm
22:00 GMT

All the best.... !!!!!!

No comments:

SpringBoot: Features: SpringApplication

Below are a few SpringBoot features corresponding to SpringApplication StartUp Logging ·          To add additional logging during startup...