PragmaticVersionControlWithCVS/AccessingTheRepository | PragmaticVersionControlWithCVS/UsingTagsAndBranches |
Contents
|
~cpp root@eunviho:~/tmp2# cvs co sesame sesame2 cvs checkout: Updating sesame U sesame/color.txt U sesame/number.txt cvs checkout: Updating sesame2 U sesame2/color.txt U sesame2/number.txt
~cpp root@eunviho:~/tmp2# cvs co sesame2/sesame2 cvs checkout: Updating sesame2/sesame2 U sesame2/sesame2/color.txt U sesame2/sesame2/number.txt cvs checkout: Updating sesame2/sesame2/templates U sesame2/sesame2/templates/test.test
~cpp root@eunviho:~/tmp2# cvs log sesame cvs log: Logging sesame RCS file: /home/CVSHOME/sesame/color.txt,v Working file: sesame/color.txt head: 1.2 branch: locks: strict access list: symbolic names: initial: 1.1.1.1 sesame: 1.1.1 keyword substitution: kv total revisions: 3; selected revisions: 3 description: ---------------------------- revision 1.2 date: 2005-08-02 13:16:58 +0000; author: sapius; state: Exp; lines: +4 -0 °í°´ÀÌ 4¤¡Áö »öÀ» ´õ ¿øÇÔ ---------------------------- revision 1.1 date: 2005-08-02 05:50:14 +0000; author: sapius; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2005-08-02 05:50:14 +0000; author: sapius; state: Exp; lines: +0 -0 ============================================================================= . . . root@eunviho:~/tmp2# cvs co -r 1.1 sesame cvs checkout: Updating sesame U sesame/color.txt U sesame/number.txt
~cpp root@eunviho:~/tmpdir/sesame# cvs update -d template cvs update: Updating template U template/file1.java root@eunviho:~/tmpdir/sesame# cvs update cvs update: Updating . U number.txt cvs update: Updating templateupdate 도중에는 변경된 사항에 대한 특이사항의 정보가 같이 출력된다.
~cpp StarterKit> cvs update ? SourceCode/tmpdoc.ilg ? SourceCode/tmpdoc.toc cvs server: Updating . RCS file: /home/CVSROOT/PP/doc/StarterKit/pragprog.sty,v retrieving revision 1.16 retrieving revision 1.17 Merging differences between 1.16 and 1.17 into pragprog.sty M pragprog.sty cvs server: Updating SourceCode A SourceCode/CommonCommands.tip M SourceCode/HowTo.tip A SourceCode/Releases.tip cvs server: Updating SourceCode/images cvs server: Updating UnitTest P UnitTest/DesignIssues.tip U UnitTest/InAProject.tip P UnitTest/Introduction.tip cvs server: Updating UnitTest/code U UnitTest/code/Age.java U UnitTest/code/TestMyStack.java U UnitTest/code/testdata.txt cvs server: Updating UnitTest/code/rev1 cvs server: Updating UnitTest/code/rev2 cvs server: Updating UnitTest/code/rev3 cvs server: Updating util? : 작업공간에는 존재하나 CVS가 알지못하는 파일
~cpp cvs 의 동작방식의 이해 cvs 는 단일 명령이 아니라 여러 하위 시스템의 집합체로 이해하는 것이 편하다. 예를 들어서 cvs -q -d /home/CVSHOME checkout -d temp -- ---------------- ------- | | | quiet mode repository checkout destination 위와 같이 동일한 옵션이지만 위치에 따라서 그 의미하는 바가 다른 결과가 나온다.
~cpp root@eunviho:~/tmpdir/sesame# cvs add template2 Directory /home/CVSHOME/sesame/template2 added to the repository root@eunviho:~/tmpdir/sesame# cd template2/ root@eunviho:~/tmpdir/sesame/template2# cvs add test.txt cvs add: scheduling file `test.txt' for addition cvs add: use `cvs commit' to add this file permanently root@eunviho:~/tmpdir/sesame/template2# cvs commit -m "new file added" cvs commit: Examining . /home/CVSHOME/sesame/template2/test.txt,v <-- test.txt initial revision: 1.1
~cpp work> cvs add DataFormat.doc #<-- forgot the -kb option cvs add: scheduling file ‘DataFormat.doc’ for addition cvs add: use ’cvs commit’ to add this file permanently work> mv DataFormat.doc Temp.doc work> cvs remove DataFormat.doc cvs remove: removed ‘DataFormat.doc’ work> mv Temp.doc DataFormat.doc work> cvs add -kb DataFormat.doc #<-- use the option cvs add: scheduling file ‘DataFormat.doc’ for addition cvs add: use ’cvs commit’ to add this file permanently work> cvs commit -m "Add new data format document"
~cpp work> # reset the flag in the repository work> cvs admin -kb DataFormat.doc work> # then reset the flags in our workspace work> cvs update -A DataFormat.doc work> # copy a known good copy over this file work> cp ?/docs/DataFormat.doc DataFormat.doc work> # and save this back in the repository work> cvs commit -m "Reset -kb flag"
~cpp dummy.java *.class *.log *.obj를 로컬 작업공간에 저장해두면 저장된 .cvsignore 를 기반해서 cvs는 그런 파일을 무시하게된다.
~cpp root@eunviho:~/tmpdir/sesame#cvs add .cvsignore root@eunviho:~/tmpdir/sesame#cvs commit -m"dummy write. ignore class, log, obj" .cvsignore
~cpp root@eunviho:~/tmp/sesame# mv color.txt color_renamed.txt root@eunviho:~/tmp/sesame# cvs remove color.txt cvs remove: scheduling `color.txt' for removal cvs remove: use `cvs commit' to remove this file permanently root@eunviho:~/tmp/sesame# cvs add color_renamed.txt cvs add: scheduling file `color_renamed.txt' for addition cvs add: use `cvs commit' to add this file permanently root@eunviho:~/tmp/sesame# cvs commit -m "color.txt renamed" cvs commit: Examining . cvs commit: Examining template cvs commit: Examining template2 /home/CVSHOME/sesame/color.txt,v <-- color.txt new revision: delete; previous revision: 1.2 /home/CVSHOME/sesame/color_renamed.txt,v <-- color_renamed.txt initial revision: 1.1이렇게 관리를 하게되면 원래 존재했던 color.txt라는 파일에 존재하는 기존의 기록들이 삭제되어서 그 파일의 과거파일을 color_rename.txt의 로그로 이용하는 것이 불가하다. 기록이 따로 보관되기 때문이다.
~cpp root@eunviho:~/tmp/sesame# cvs status color.txt =================================================================== File: no file color.txt Status: Up-to-date Working revision: No entry for color.txt Repository revision: 1.3 /home/CVSHOME/sesame/Attic/color.txt,v위에서 보듯 color_renamed.txt라는 파일의 버전이 1.1인 것에 반해서 color.txt가 1.3버전임을 확인할 수 있다.