1 / 15

Revision Control System (RCS)

Revision Control System (RCS). Author : Ya-Ling Wang and Quincy Wu Date : 2012/07/17. What is RCS. Revision Control System A kind of SCCS ( Source Code Control System ) Manage multiple revisions of files Some editors will keep the previous version for backup vim (:set backup)

trygg
Télécharger la présentation

Revision Control System (RCS)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Revision Control System(RCS) Author : Ya-Ling Wang and Quincy Wu Date : 2012/07/17

  2. What is RCS • Revision Control System • A kind of SCCS (Source Code Control System) • Manage multiple revisions of files • Some editors will keep the previous version for backup • vim (:set backup) • You may manually save your programs as • hw-20120718-v1.c • hw-20120718-v2.c • hw-20120718-v3.c • hw-20120718-v4.c • This wastes the disk space because they may be 90% identical. • You are unable to see which is the version you need for a specific feature. • Support single-user and multiple-user

  3. Keywords • Archive file • Keep all versions in one file (ex : test.c,v) • Check in ( ci )/ Check out ( co ) • Revision number • Default : 1.1 • Branch → • Log

  4. Check in / Check out test.c test.c,v Check in Check out Check outwithout lock Check outwith lock ex.txt,v HW.sh,v ex.txt RCS HW.sh

  5. Initialize • Where to save archive files? $ mkdir RCS Q: if there is no RCS/ Q: if there is rcs/ • Create and initialize a new RCS file $ rcs -i test.c RCS file: RCS/test.c,v enter description, terminated with single '.' or end of file: NOTE: This is NOT the log message! >> • Initial revision 1.1 • This creates test.c,v; you have to manually remove test.c • Actually, I prefer to initialize the RCS by simply checking in the source file. test.c RCS test.c,v

  6. Check In • Check in to update archive file $ ci test.c RCS/test.c,v <-- test.c new revision: 1.5; previous revision: 1.4 enter log message, terminated with single '.' or end of file: >> • Check in and comment $ ci -m”comment” test.c # You may automatically check in the file at a specific time. $ at 1000 July 18ci -m“zone file on July 18” xxx.ncnu.info

  7. Check Out • Check out from the archive file $ co test.c • Read only • If you want to modify the file, you have to lock it! $ co -l test.c • Only one user can lock at a time • If not the latest revision, which revision do you want? $ co -r1.2 test.c

  8. Revisions Stored in the Archive File • Only the full text of the latest revision is stored. • The “difference” between revisions are included in the archive file so that you can restore older revisions.

  9. Contents in the Archive File • Example • d = delete • a = add • d4 1 • Delete one line from line 4 • a5 1 • AAA • Add one line “AAA” from line 6 1.3 @Monday Tuesday Wednesday Thursday Friday Saturday Sunday @ 1.2 @ d3 1 a3 1 Thursday d6 2 @ 1.2 @Monday Tuesday Thursday Thursday Friday @

  10. DEMO $ yum install rcs $ mkdir RCS $ vi test.c $ ci test.c >> description $ ls $ ls RCS $ co test.c # 1.1 $ ls -al $ co –l test.c # locked $ ls -al $ vi test.c $ ci test.c # 1.2 >> Comment $ co -l test.c; vi test.c $ ci -r2.0 test.c $ rlog test.c

  11. Log Messages • rlog test.c RCS file: test.c,v Working file: test.c head: 1.3 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 3; selected revisions: 3 description: Introduction to Asterisk ---------------------------- revision 1.3 date: 2012/07/17 16:41:23; author: solomon; state: Exp; lines: +1 -1 Enhance the function added by Ya-Dong. ---------------------------- revision 1.2 date: 2012/07/17 16:40:33; author: winter; state: Exp; lines: +1 -0 Add one line ---------------------------- revision 1.1 date: 2012/07/17 16:38:41; author: solomon; state: Exp; Initial revision ---------------------------- GMT

  12. Advanced Usage • RCS keywords • $Id$ • ident(1) • $Revision$ • /* * $Log$ */ • Compare RCS revision $ rcsdiff -r1.2 -r2.0 test.c • Default : latest revision & working file

  13. Version Control Tools • Revision Control System ( RCS ) • Simple version control system on a single host • Concurrent Version System ( CVS ) • Used for team project development • Subversion ( SVN ) Windows/Linux • Include the revision control of directory • Git • Powerful (Fast, Easy, Distributed )

  14. References • RCSINTRO(1) • Introduction to RCS • Linux HOWTO - Using RCS • The RCS Mini-HOWTO

  15. Exercises • Please checkout revision 1.1 of this Archive file • How to compare different revisions in a file • Use “man rcsdiff” to learn what options are available. Choose one option to share with your labmates. • Please create the branches of P.3 • Download tree,v and execute “rlog tree,v” to show the revisions. • Try to create a similar file with several branches. • What will happened if there is no directory RCS or if there is a directory rcs?

More Related