For permanent command options
edit .cvsrc file in home directory
e.g.:
diff -c
update -P
cvs -q
the cvs -q part is a global option
getting snapshots
By Date
cvs -q update -D "2003-09-22"
this means the first moment of September 22nd, 2003, to get stuff up tp 1:00 that afternoon:
cvs -q update -D "2003-09-22 13:00:00 GMT"
don't forget the GMT!
updating with -D will give you a sticky date that your working directory will remember until you run with -A or a different -D
You cannot check in changes with a sticky date, but you can diff them:
cvs -q diff -c -r 1.5 index.php
Adding a tag
tag marks a certain point in time in the development process
cvs -q tag "Test_Release-2003_09_22"
tag must start with letter and consist of letters, digits, hyphens, and undescores ([a-z][A-Z][0-9]-_)
Checking out a separate working copy at a tag
move to a new directory (not in existing working copy or parent directory)
cvs -d (CVS_ROOT information) checkout -r release_name project_name
Comparing current state to tagged state:
cvs diff -c -r Release_Name file name
Revert temporarily to tag:
cvs update -r Release_Name [filename]
(cannot check in changes to a release unless it is a branch [branches discussed next time])
as before update with -A option or a different revision or date to lose or change sticky option
an example of what I did to make this happen:
first make sure that you know which revision you want, check it out temporarily and have a look at it. I wanted revision 1.20 of the file en/2004/exhibitors/f-inf_promotion.html
so first I ran cvs update with the -p parameter to write it to standard output
cvs up -p -r 1.20 en/2004/exhibitors/f-inf_promotion.html
This was how I wanted it the first time, because I have my .cvsrc file set up to always add the -q tag to my cvs commands. If you don't have this then you will see some cruft before the contents of your file. This is exactly why we ran the file this way first. (In actuality the extra cruft that not using -q produces is harmless and wouldn't actually go into your file, but I always feel safer making sure it isn't there)
(you would run it like this to fix it):
cvs -q up -p -r 1.20 en/2004/exhibitors/f-inf_promotion.html
after you have verified that what is being printed to your screen is exactly what you want as the contents of your file you will direct this output into the file itself:
cvs up -p -r 1.20 en/2004/exhibitors/f-inf_promotion.html > en/2004/exhibitors/f-inf_promotion.html
Now just check in, and you are back to the desired version of the file.
Posted by ultrabob at September 23, 2003 01:10 AM