1 / 27

버전관리와 CVS

버전관리와 CVS. Presentation by Stania Hwang stania@stania.pe.kr. 들어가며 – 버전관리의 필요성. 버전관리 없는 프로젝트 = Undo 버튼 없는 문서편집기 전체 프로젝트의 되돌림 버튼이 생김 동일한 코드를 가지고 여러 개발자가 잘 정리된 방식으로 작업할 수 있음 . 기록을 유지함으로써 다른 의사소통 없이도 파일에 어떤 변경이 가해졌는지 알 수 있음 . 중심 개발 버전을 계속 개발함과 동시에 과거 릴리즈를 동시에 지원할 수 있음 .

wiley
Télécharger la présentation

버전관리와 CVS

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. 버전관리와 CVS Presentation by Stania Hwang stania@stania.pe.kr

  2. 들어가며 – 버전관리의 필요성 • 버전관리 없는 프로젝트= Undo 버튼 없는 문서편집기 • 전체 프로젝트의 되돌림 버튼이 생김 • 동일한 코드를 가지고 여러 개발자가 잘 정리된 방식으로 작업할 수 있음. • 기록을 유지함으로써 다른 의사소통 없이도 파일에 어떤 변경이 가해졌는지 알 수 있음. • 중심 개발 버전을 계속 개발함과 동시에 과거 릴리즈를 동시에 지원할 수 있음. • 과거 프로젝트의 모습을 정확히 보여줄 수 있음.

  3. 용어의 이해 및 기본 설명 • 저장소 • 저장소에 저장되어야 할 것들 • 체크아웃 • 전송 • 갱신 • 버전관리 • 꼬리표 • 브랜치 • 낙관적인 잠금/엄격한 잠금

  4. 간단한 CVS의 사용 • 저장소 만들기 • cvs –d ~/sandbox init • CVS를 사용하기 위한 환경 • GUI • WINCVS • TORTOISE CVS • IDE 에서의 CVS 지원

  5. 간단한 프로젝트 만들기 • cvs -d [cvsroot path] import -m "comment" repository vendor-t release-t • $ cvs -d ~/cvs import -m " " ds_hw1 ds_hw1 initial <stania@estania-note: ~/works/DStructure/homework4_cvs> $ cvs import -m "자료구조 1번 과제 프레임워크" ds_hw1 ds_hw1 initial N ds_hw1/Sort_ori.java N ds_hw1/Sort.java N ds_hw1/input1 No conflicts created by this import

  6. 작업 준비 <stania@estania-note: ~/works/DStructure/homework4_cvs> $ cvs co -d . ds_hw1 cvs checkout: Updating . U Sort.java U Sort_ori.java U input1 <stania@estania-note: ~/works/DStructure/homework4_cvs> $ ls CVS/ Sort.java Sort_ori.java input1

  7. 새로운 파일을 추가 <stania@estania-note: ~/works/DStructure/homework4_cvs> $ cat sort_algorithm bubble insertion shell radix heap merge quick $ cvs add sort_algorithm cvs add: scheduling file `sort_algorithm' for addition cvs add: use `cvs commit' to add this file permanently $ cvs commit cvs commit: Examining . /home/stania/cvs/ds_hw1/sort_algorithm,v <-- sort_algorithm initial revision: 1.1

  8. 파일의 수정 및 적용 <stania@estania-note: ~/works/DStructure/homework4_cvs> $ vi sort_algorithm <stania@estania-note: ~/works/DStructure/homework4_cvs> $ cvs status sort_algorithm ========================================================== File: sort_algorithm Status: Locally Modified Working revision: 1.1 Fri Feb 25 04:10:16 2005 Repository revision: 1.1 /home/stania/cvs/ds_hw1/sort_algorithm,v Sticky Tag: (none) Sticky Date: (none) Sticky Options: (none)

  9. 파일의 수정 및 적용 $ cvs diff sort_algorithm Index: sort_algorithm ======================================================= RCS file: /home/stania/cvs/ds_hw1/sort_algorithm,v retrieving revision 1.1 diff -r1.1 sort_algorithm 7a8 > n-ary heap $ cvs diff --side-by-side sort_algorithm Index: sort_algorithm ========================================================== RCS file: /home/stania/cvs/ds_hw1/sort_algorithm,v retrieving revision 1.1 diff --side-by-side -r1.1 sort_algorithm bubble bubble insertion insertion shell shell radix radix heap heap merge merge quick quick > n-ary heap

  10. 파일의 수정 및 적용 <stania@estania-note: ~/works/DStructure/homework4_cvs> $ cvs commit cvs commit: Examining . /home/stania/cvs/ds_hw1/sort_algorithm,v <-- sort_algorithm new revision: 1.2; previous revision: 1.1 <stania@estania-note: ~/works/DStructure/homework4_cvs> $ cvs log sort_algorithm RCS file: /home/stania/cvs/ds_hw1/sort_algorithm,v Working file: sort_algorithm head: 1.2 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.2 date: 2005-02-25 04:57:49 +0000; author: stania; state: Exp; lines: +1 -0 잊었던 과제 2의 요구사항을 추가함 ---------------------------- revision 1.1 date: 2005-02-25 04:10:51 +0000; author: stania; state: Exp; 사용자가 원하는 소팅 알고리즘의 종류를 기록 =============================================================================

  11. 병합, 충돌의 발생 <stania@estania-note: ~/works/DStructure/homework4_cvs> $ vi sort_algorithm <stania@estania-note: ~/works/DStructure/homework4_cvs> $ cvs commit cvs commit: Examining . cvs commit: Up-to-date check failed for `Sort.java' cvs commit: Up-to-date check failed for `sort_algorithm' cvs [commit aborted]: correct above errors first! <stania@estania-note: ~/works/DStructure/homework4_cvs> $ cvs status Sort.java =================================================================== File: Sort.java Status: Needs Merge Working revision: 1.1.1.1 Fri Feb 25 04:02:50 2005 Repository revision: 1.2 /home/stania/cvs/ds_hw1/Sort.java,v Sticky Tag: (none) Sticky Date: (none) Sticky Options: (none)

  12. 병합, 충돌의 발생 <stania@estania-note: ~/works/DStructure/homework4_cvs> $ cvs log Sort.java RCS file: /home/stania/cvs/ds_hw1/Sort.java,v Working file: Sort.java head: 1.2 branch: locks: strict access list: symbolic names: initial: 1.1.1.1 ds_hw1: 1.1.1 keyword substitution: kv total revisions: 3; selected revisions: 3 description: ---------------------------- revision 1.2 date: 2005-02-25 05:03:52 +0000; author: stania; state: Exp; lines: +110 -2 shell sort, quick sort 알고리즘을 작성 - stania2 ---------------------------- revision 1.1 date: 2005-02-25 04:02:50 +0000; author: stania; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2005-02-25 04:02:50 +0000; author: stania; state: Exp; lines: +0 -0 자료구조 1번 과제 프레임워크 =============================================================================

  13. 병합, 충돌의 발생 <stania@estania-note: ~/works/DStructure/homework4_cvs> $ cvs update cvs update: Updating . RCS file: /home/stania/cvs/ds_hw1/Sort.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 Merging differences between 1.1.1.1 and 1.2 into Sort.java M Sort.java RCS file: /home/stania/cvs/ds_hw1/sort_algorithm,v retrieving revision 1.2 retrieving revision 1.3 Merging differences between 1.2 and 1.3 into sort_algorithm M sort_algorithm

  14. 병합, 충돌의 발생 <stania@estania-note: ~/works/DStructure/homework4_cvs> $ vi Sort.java <stania@estania-note: ~/works/DStructure/homework4_cvs> $ cvs commit cvs commit: Examining . cvs commit: Up-to-date check failed for `Sort.java' cvs commit: Up-to-date check failed for `sort_algorithm' cvs [commit aborted]: correct above errors first! $ cvs log -r1.4 Sort.java RCS file: /home/stania/cvs/ds_hw1/Sort.java,v Working file: Sort.java head: 1.4 branch: locks: strict access list: symbolic names: initial: 1.1.1.1 ds_hw1: 1.1.1 keyword substitution: kv total revisions: 5; selected revisions: 5 description: ---------------------------- revision 1.4 date: 2005-02-25 05:18:20 +0000; author: stania; state: Exp; lines: +63 -1 mergesort 를 구현

  15. CVS Repository 생성/접근 • CVS Repository 만들기 • cvs -d [PATH] init • CVS Repository 에 접근하기 • ssh 를 사용한 안전한 접속 • CVSROOT, CVS_RSH환경변수를 설정해준다. • CVSROOT=:ext:stania@upnl.org:/home/cvsroot • CVS_RSH=ssh • CVS_RSH 는 cvs 의 -d 옵션 파라미터나 CVSROOT 설정이 :ext:일 때 사용할 프로토콜이 적힌다. • CVSROOT 는 cvs 사용시의 -d 옵션을 대체할 수 있다. • pserver 를 이용한 (익명) 저장소에의 접근 • CVSROOT=:pserver:dave@my.repository.com:/var/repository • cvs login/logout을 통해 접근 전/후 에 인증과정을 거쳐야 한다.

  16. CheckOut (co) • cvs co client server • cvs co client/templates • 기본브랜치(중심개발축)의 가장 최신버전을 체크아웃 • 옵션 • -d : 체크아웃된 모듈이 저장될 디렉토리 • -r : 특정 개정판을 체크아웃 • -D : 날짜 기준 • ISO8601 : 2005-02-26, 20050226, 2005-02-26 12:08 • 상대적 날짜 : 1 day ago, 27 minutes ago, last Monday, yesterday, third week ago • 특정 개정판을 기준으로 체크아웃시 • sticky 개정판 디렉토리가 생성 – 해당 개정판에만 변경 적용

  17. update • 디렉토리의 내용을 최신 정보로 유지함. • 옵션 • -d : 저장소를 기준으로 추가된 디렉토리를 지역 작업공간에 새로 만든다. • 수행 결과 태그 • M : 지역에서 수정된 파일 • A : 지역에서 추가되긴 했으나 아직 저장소로 commit 되지 않은 파일 • U, P : 저장소 버전에 의해 지역 파일이 변경되었음 • ? : 지역 작업공간에는 있으나 저장소에는 없어서 어찌 처리할지를 모르는 파일들 • C : 파일 병합 충돌시.

  18. add/remove • 파일이나 디렉토리를 저장소에 추가/삭제 한다 • add 옵션 • -m : 추가 작업에 대한 코멘트를 추가한다. • -kb : 해당 파일을 바이너리파일로 지정한다. 이 파일들에 대해선 cvs 가 일반 텍스트 파일에 대해 수행하는 작업들을 하지 않는다.

  19. 특정 파일들을 무시 • .cvsignore Dummy.java *.class *.log

  20. 파일 이름 변경 <stania@upnl: ~/works/DStructure/homework4_cvs> $ ls CVS/ Sort.java Sort_ori.java input1 sort_algorithm <stania@upnl: ~/works/DStructure/homework4_cvs> $ cvs -q update -d <stania@upnl: ~/works/DStructure/homework4_cvs> $ mv Sort_ori.java Sorting.java <stania@upnl: ~/works/DStructure/homework4_cvs> $ cvs remove Sort_ori.java cvs remove: scheduling `Sort_ori.java' for removal cvs remove: use `cvs commit' to remove this file permanently <stania@upnl: ~/works/DStructure/homework4_cvs> $ cvs add Sorting.java cvs add: scheduling file `Sorting.java' for addition cvs add: use `cvs commit' to add this file permanently <stania@upnl: ~/works/DStructure/homework4_cvs> $ cvs commit -m "Sort_ori.java 의 이름을 Sorting.java로 변경" cvs commit: Examining . /home/stania/cvs/ds_hw1/Sort_ori.java,v <-- Sort_ori.java new revision: delete; previous revision: 1.1.1.1 /home/stania/cvs/ds_hw1/Sorting.java,v <-- Sorting.java initial revision: 1.1 <stania@upnl: ~/works/DStructure/homework4_cvs> $ ls CVS/ Sort.java Sorting.java input1 sort_algorithm

  21. 디렉토리 이름 변경 • 새 디렉토리를 생성 • 새 디렉토리를 CVS에 추가 • 옛날 디렉토리에서 새 디렉토리로 파일 이동 • 옛날 디렉토리에서 cvs remove 를 적용새 디렉토리에서 cvs add 를 적용 • 변경 내용을 commit-P 선택사항을 붙여 cvs update(기존 디렉토리를 삭제한다) • (-P 옵션은 지역 작업공간에서 빈 디렉토리를 모두 삭제해준다)

  22. diff • cvs diff FILENAME • 마지막으로 체크아웃한 저장소의 버전, 지역 작업공간 • 자신이 체크아웃 후 무슨 일을 했는지 알 수 있음 • cvs diff -c FILENAME • 변경된 부분 주변의 맥락을 같이 • cvs diff -rRN -rRN FILENAME • RN : Revision Number • 두 버전 사이의 차이점 • cvs diff -r HEAD FILENAME • 저장소의 최신 개정판, 지역 작업공간

  23. commit, log • commit • cvs update -d 사용 후 cvs commmit 을 사용하는 쪽이 좋다. • 의미있는 주석을 남기도록 하자. • log • 파일에 관한 정보와 그 동안 팀원들이 달아둔 메시지를 볼 수 있다. • -r, -d 선택사항을 사용해 버전별/날짜별 log 를 볼 수도 있다.

  24. 변경 사항을 되돌리기 • cvs update -j1.5 -j1.4 Sort.java • 1.5와 1.4 의 위치에 주목하자 • 1.5 와 1.4 사이의 변경을 취소하고, 그 결과를 현재 지역 작업공간에도 적용한다. • 문제가 될 만한 변화 직전/직후에 코드 전체에 꼬리표를 달아두면, 여러 파일에 걸친 변화도 쉽게 복구가 가능하다

  25. 꼬리표와 브랜치 • 꼬리표의 쓰임새 • 릴리즈 브랜치를 만들 때 (브랜치 꼬리표를 사용해 분리한다) • 릴리즈를 출시할 때 • 버그를 고칠 때 (버그 해결 직전/직후에 꼬리표 설정) • 개발자가 실험할 때 (프로젝트 전체에 큰 변경을 가할 때) • 릴리즈 브랜치 • 만들기 : cvs rtag -b BR_1_0 project • 체크아웃 : cvs co -r BR_1_0 -d br1.0 project • 릴리즈 태그 • 만들기 : cvs tag REL_1_0지역 작업공간에 마지막으로 체크아웃한 개정판에 태그를 단다 • 릴리즈 브랜치에서의 버그 수정 후 중심 개발축에 적용하기 • (중심 브랜치 안에서)cvs update -j PRE_1234 -j POST_1234

  26. 질문 및 답변

  27. Presentation Information • 일시 : 2005년 2월 26일 UPnL 0 차 비공식 워크샵 • 장소 : 서울대학교 302-311-1 • http://upnl.org/wiki/wiki.php/Workshop/00th050226/CVS • 참고문헌 • 정지호 역, 실용주의 프로그래머를 위한 버전관리 using CVS, 2004, 인사이트 • 김대영, 김태경 역, 리눅스 서버 관리 Hacks 100(Linux Server Hacks), 2003, 한빛미디어(O'REILLY) • 제작 : 황원근(stania, stania@stania.pe.kr) • http://stania.pe.kr • http://stania.egloos.com

More Related