RCS Revision Control System SIMG 726 Winter Quarter 2003 Rolando V. Raqueño
What is RCS? RCS (Revision Control System) Allows you to locally journal and archive code/files under development Protects copies of working code from being destroyed by experimental modifications Assures that only one person is editing each file Facilitates additional documentation associated with different versions of code Winter Quarter 2003 Rolando V. Raqueño
Sample RCS Case We will create a sample case to illustrate the mechanics of using RCS Use the simple sum program case test_sum.pro sum.pro input.dat output.dat Winter Quarter 2003 Rolando V. Raqueño
General Setup and Use of RCS Initial setup Create a directory for the “project” Create the RCS repository directory Create the program and data files Check in the files into RCS After initial setup Check out the files out of RCS Edit the files Check the files back into RCS Repeat as needed Winter Quarter 2003 Rolando V. Raqueño
Create a directory for the project % mkdir test_sum test_sum test_sum.pro sum.pro input.dat Winter Quarter 2003 Rolando V. Raqueño
test_sum.pro pro test_sum data = fltarr(2,3,4) openr,input_file,‘input.dat’,/get_lun openw,output_file,‘output.dat’,/get_lun readf, input_file, data answer = sum( data ) printf, output_file, answer free_lun, input_file, output_file end Winter Quarter 2003 Rolando V. Raqueño
sum.pro function sum, x n = n_elements(x) answer = double(x[0]) for i = 1L, n-1 do begin answer = answer + x[i] end return, answer Winter Quarter 2003 Rolando V. Raqueño
input.dat 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Winter Quarter 2003 Rolando V. Raqueño
Create an RCS directory repository % mkdir RCS test_sum test_sum.pro sum.pro input.dat RCS Winter Quarter 2003 Rolando V. Raqueño
Check in your files using the ci command % ci test_sum.pro sum.pro input.dat You will be prompted for input describing each of the files. Enter an appropriate description to help you and others document the file Winter Quarter 2003 Rolando V. Raqueño
Description of input.dat RCS/input.dat,v <-- input.dat enter description, terminated with single '.' or end of file: NOTE: This is NOT the log message! >> This is the test input data set for test_sum.pro >> and sum.pro >> . initial revision: 1.1 done Winter Quarter 2003 Rolando V. Raqueño
Description of sum.pro RCS/sum.pro,v <-- sum.pro enter description, terminated with single '.' or end of file: NOTE: This is NOT the log message! >> This function sums an array in IDL >> . initial revision: 1.1 done Winter Quarter 2003 Rolando V. Raqueño
Description of test_sum.pro RCS/test_sum.pro,v <-- test_sum.pro enter description, terminated with single '.' or end of file: NOTE: This is NOT the log message! >> This program is a test program to validate sum.pro >> . initial revision: 1.1 done Winter Quarter 2003 Rolando V. Raqueño
Create an RCS directory repository % ls RCS test_sum RCS test_sum.pro,v sum.pro,v input.dat,v Winter Quarter 2003 Rolando V. Raqueño
Checking the status of a file in the RCS repository % rlog test_sum.pro RCS file: RCS/test_sum.pro,v Working file: test_sum.pro head: 1.1 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 1; selected revisions: 1 description: This program is a test program to validate sum.pro ---------------------------- revision 1.1 date: 2003/02/05 13:45:30; author: rvrpci; state: Exp; Initial revision Winter Quarter 2003 Rolando V. Raqueño
Checking out a file for read-only % co sum.pro RCS/sum.pro,v --> sum.pro revision 1.1 done test_sum sum.pro RCS test_sum.pro,v sum.pro,v input.dat,v Winter Quarter 2003 Rolando V. Raqueño
sum.pro ONLY for VIEWING You cannot edit this file because of the protections % ls -l sum.pro -r--r----- … sum.pro Winter Quarter 2003 Rolando V. Raqueño
To Make sum.pro writable % co -l sum.pro RCS/sum.pro,v --> sum.pro revision 1.1 (locked) done % ls -l sum.pro -rw-r----- … sum.pro Winter Quarter 2003 Rolando V. Raqueño
sum.pro ;$Header$ ;$Log$ function sum, x n = n_elements(x) answer = double(x[0]) for i = 1L, n-1 do begin answer = answer + x[i] end return, answer Winter Quarter 2003 Rolando V. Raqueño
Create an RCS directory repository % ls RCS test_sum test_sum.pro sum.pro input.dat RCS test_sum.pro,v sum.pro,v input.dat,v Winter Quarter 2003 Rolando V. Raqueño
Subsequent Check in of sum.pro after edits % ci sum.pro RCS/sum.pro,v <-- sum.pro new revision: 1.2; previous revision: 1.1 enter log message, terminated with single '.' or end of file: >> Added RCS keywords for documentation. >> . done Winter Quarter 2003 Rolando V. Raqueño
Checking out current version of sum.pro % co sum.pro RCS/sum.pro,v --> sum.pro revision 1.2 done Winter Quarter 2003 Rolando V. Raqueño
Current sum.pro % more sum.pro ;$Header: /cis/staff/rvrpci/public_html/teaching/simg726/20022/testing/test_sum/ RCS/sum.pro,v 1.2 2003/02/05 14:11:49 rvrpci Exp $ ;$Log: sum.pro,v $ ;Revision 1.2 2003/02/05 14:11:49 rvrpci ;Added RCS keywords for documentation. ; function sum,x … end Winter Quarter 2003 Rolando V. Raqueño
Checking for differences % rcsdiff -r1.1 sum.pro =========================================================== RCS file: RCS/sum.pro,v retrieving revision 1.1 diff -r1.1 sum.pro 0a1,5 > ;$Header: /cis/staff/rvrpci/public_html/teaching/simg726/20022/testing/test_sum/RCS/sum.pro,v 1.2 2003/02/05 14:11:49 rvrpci Exp $ > ;$Log: sum.pro,v $ > ;Revision 1.2 2003/02/05 14:11:49 rvrpci > ;Added RCS keywords for documentation. > ; Winter Quarter 2003 Rolando V. Raqueño
Checking the log of a file % rlog sum.pro … ---------------------------- revision 1.2 date: 2003/02/05 14:11:49; author: rvrpci; state: Exp; lines: +2 -0 Added RCS keywords for documentation. revision 1.1 date: 2003/02/05 13:45:30; author: rvrpci; state: Exp; Initial revision ====================================================== Winter Quarter 2003 Rolando V. Raqueño
rcsfreeze Allows you to group checked in RCS entries into a logical unit Example % rcsfreeze Ground_Hog_Day % co -rGround_Hog_Day RCS/*,v Winter Quarter 2003 Rolando V. Raqueño