2007년 7월 3일 화요일

mercurial 버전관리 시스템

CVS나 subversion과 같은 느리고 복잡한 소스 코드 관리 시스템을
운영하다가 과로로 쓰러진 관리자가 속출하자 개발보다 관리에
더 신경을 쓸 수 없다고 생각한 일련의 개발자들이 초경량
초고속 분산 소스 코드 관리 시스템을 새롭게 작성하기로
마음먹고 시작한 프로젝트인 Mercurial(이하 hg로 부른다)이
드디어 정식 릴리즈로 한걸음씩 다가서고 있다.

안그래도 소스 코드 관리 시스템 종류가 많은 상황에서
또 하나 추가되면 머리가 더 아파지지 않겠느냐는 걱정이 앞설텐데...
hg의 미니멀리즘적인 단순한 명령어
(http://www.selenic.com/mercurial/wiki/index.cgi/QuickStart)를
딱 보면... 갑자기 정신이 번쩍 들테다.

프로젝트 생성 방법을 한번 볼까?

$ cd project/
$ hg init # creates .hg
$ hg addremove # add all unknown files and remove all missing files
$ hg commit # commit all changes, edit changelog entry

가지치기와 결합은 또 어떻구?

$ hg clone linux linux-work # create a new branch
$ cd linux-work
$
$ hg commit
$ cd ../linux
$ hg pull ../linux-work # pull changesets from linux-work
$ hg update -m # merge the new tip from linux-work into
# our working directory
$ hg commit # commit the result of the merge

패치 입수가 진짜 예술이다.
$ cat ../p/patchlist | xargs hg import -p1 -b ../p

패치 생성은 또 어떻구?
(make changes)
$ hg commit
$ hg tip
28237:747a537bd090880c29eae861df4d81b245aa0190
$ hg export 28237 > foo.patch # export changeset 28237

분산 환경이라고 했지? 네트워크 설정을 보면 입이 벌어질거다.
이거 만든 개발자는 진짜 천재다.

# pull from the primary Mercurial repo
foo$ hg clone http://selenic.com/hg/
foo$ cd hg

# export your current repo via HTTP with browsable interface
foo$ hg serve -n "My repo" -p 80

# pushing changes to a remote repo with SSH
foo$ hg push ssh://user@example.com/~/hg/

# merge changes from a remote machine
bar$ hg pull http://foo/
bar$ hg update -m # merge changes into your working directory

# Set up a CGI server on your webserver
foo$ cp hgweb.cgi ~/public_html/hg/index.cgi
foo$ emacs ~/public_html/hg/index.cgi # adjust the defaults

hg 설명 끝이다. 지금 바로 hg 사용 준비하시라!

http://www.selenic.com/mercurial/wiki/index.cgi

댓글 없음: