Recommended Repository Layout
While Subversion's flexibility allows you to lay out your repository in any way that you choose, we recommend that you create a trunk directory to hold the “main line” of development, a branches directory to contain branch copies,
and a tags directory to contain tag copies. For example:

$ svn list file:///var/svn/repos
/trunk
/branches
/tags

You'll learn more about tags and branches in Chapter 4, Branching and Merging. For details and how to set up multiple projects, see the section called “Repository Layout” and the section called “Planning Your Repository Organization” to read more about project roots.

[출처 : svnbook.red-bean.com/nightly/en/svn-book.pdf]

cvs2svn으로 변환해보니 저러한 구조가 나왔는데, 아무생각없이 저 391장에 이르는 문서를 대충 넘기다 보니
정말 아무생각없이 넘어간 듯 하다.(38페이지)



브랜치쪽 역시.. 그냥 그림만 봤지 자세한 내용을 안봤더니..(106페이지)

'프로그램 사용 > Version Control' 카테고리의 다른 글

SVN의 장점  (0) 2009.09.19
svn tagging/branching  (0) 2009.08.20
SVN과 CVS 저장소 용량비교(compare Repository Size of CVS & SVN)  (0) 2009.05.11
cvs2svn 사용방법  (0) 2009.05.10
SVN의 단점  (0) 2009.05.08
Posted by 구차니
SVN은 바이너리 타입으로 데이터를 저장한다.
그리고 데이터는 zlib를 사용하여 압축하기 때문에 텍스트의 경우 상당한 공간 절약 효과가 있다 (CVS 대비)

테스트 삼아 CVS -> SVN 변환하면서 어느정도 용량의 차이가 있을까 궁금해서 캡쳐를 해보았다.


보시다시피, SVN은 CVS를 변환한 것임에도 불구하고 거의 1/4 크기 정도 밖에 되지 않는다. (25% 크기로 압축됨)

[참고 : http://stackoverflow.com/questions/458182/does-svn-compress-the-binary-content]


'프로그램 사용 > Version Control' 카테고리의 다른 글

svn tagging/branching  (0) 2009.08.20
SVN repository 구조  (0) 2009.05.11
cvs2svn 사용방법  (0) 2009.05.10
SVN의 단점  (0) 2009.05.08
svn 저장소의 위치  (0) 2009.05.08
Posted by 구차니
A Few Examples

To create a new Subversion repository by converting an existing CVS repository, run the script like this:
   $ cvs2svn --svnrepos NEW_SVNREPOS CVSREPOS

To create a new Subversion repository containing only trunk commits, and omitting all branches and tags from the CVS repository, do
   $ cvs2svn --trunk-only --svnrepos NEW_SVNREPOS CVSREPOS

To create a Subversion dumpfile (suitable for 'svnadmin load') from a CVS repository, run it like this:
   $ cvs2svn --dumpfile DUMPFILE CVSREPOS

To use an options file to define all of the conversion parameters, specify --options:
   $ cvs2svn --options OPTIONSFILE

As it works, cvs2svn will create many temporary files in a temporary directory called "cvs2svn-tmp" (or the directory specified with --tmpdir). This is normal. If the entire conversion is successful, however, those tempfiles will be automatically removed. If the conversion is not successful, or if you specify the '--skip-cleanup' option, cvs2svn will leave the temporary files behind for possible debugging.

[출처  : http://cvs2svn.tigris.org/cvs2svn.html]

cvs2svn은 cvs 리파지터리를 svn으로 변환해주는 툴이다.
변환과정중에 하나라도 잘못된 ,v 파일(cvs의 history 파일)이 있으면 중지되고,
한글을 사용했을 경우, encoding 문제로 인해서 pass 2에서 문제가 발생한다.

ERROR: There were warnings converting author names and/or log messages
to unicode (see messages above).  Please restart this pass
with one or more '--encoding' parameters or with '--fallback-encoding'.

$ man cvs2svn
       --encoding=encoding
              Use  encoding  as  the  encoding for filenames, log messages, and
              author names in the CVS repos.  This option may be specified mul-
              tiple times, in which case the encodings are tried in order until
              one        succeeds.         Default:         ascii.          See
              http://docs.python.org/lib/standard-encodings.html  for a list of
              other standard encodings.

       --fallback-encoding=encoding
              If none of the encodings specified  with  --encoding  succeed  in
              decoding  an  author name or log message, then fall back to using
              encoding in lossy 'replace' mode.  Use of this option  may  cause
              information  to be lost, but at least it allows the conversion to
              run to completion.  This option only affects the encoding of  log
              messages  and  author  names;  there  is no fallback encoding for
              filenames.  (By using an --options file, it is possible to  spec-
              ify a fallback encoding for filenames.)  Default: disabled.

그래서 위에 나온 링크에서 encoding 항목을 뒤져 보았다.
 Codec  Aliases  Languages
 cp949  949, ms949, uhc  Korean
 euc_kr  euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001  Korean
 iso2022_jp_2  iso2022jp-2, iso-2022-jp-2  Japanese, Korean, Simplified Chinese, Western Europe, Greek
 iso2022_kr  csiso2022kr, iso2022kr, iso-2022-kr  Korean
 johab  cp1361, ms1361  Korean

[출처 : http://docs.python.org/library/codecs.html#standard-encodings]



acroedit에서 열어 보니 ANSI-UNIX-949 라고 나온다.
windows에서 TortoiseCVS로 사용했다면 cp949로 encoding을 설정하면 이상없이 변환된다.

아무튼 실행은 아래의 명령어로 한다.
$ cvs2svn --svnrepos svn/ --encoding=cp949 /home/cvs/

변환 pass가 상당히 많다. 오래 걸리는 것은 pass 1 과 pass 16이다.


변환된 결과


cvs에 여러개의 소스들이 있는데, 전부 trunk 아래로 들어가게 되엇다.
그리고 tag과 branch 역시 분리 되어있다.


로그메시지는, 너무 많은 관계로 100개씩 만 보이게 되어 있고,
하나의 리파지터리에 들어 오는 바람에, 연관이 없는 다른 프로젝트의 revision과 함께 섞였다.
이런 이유로, 다른 소스는 다른 리파지터리에 저장을 해줘야 할 듯 하다.
Posted by 구차니
출근길에 SVN 설명서를 읽어 보니..

svn에 접속하는 방법으로는

file://
svn://
svn+ssh://
http://

정도가 있다고 한다.

근데.. http:// 를 이용하는 방법 외에는
svn 사용 로그가 남는 방법이 없다고 한다.

cvs에 비해서는 사용로그가 남지 않는 다는 건 관리자 측면에서는 아쉽지만,
사용자 측면에서는 아무런 아쉬움이 없으니 음..



[출처  : http://svnbook.red-bean.com/nightly/en/svn-book.pdf]
Posted by 구차니
예를 들어
/home/svn 이 svn의 저장소를 놓을 위치이고
그 아래에 각각의 프로젝트가 들어 간다면

저장소의 위치는 /home/svn이다.

svnserve -d로 구동할때 의 경로는 /home/svn이 되고
svn으로 checkout을 할때의 경로는 각 프로젝트를 넣어 준다.

예를 들어

/home/svn/proj1
/home/svn/proj2
가 있다면

svn://svnserver.ip.addr/proj1
이런식으로 접속하면 프로젝트에 대해서 보인다.

음.. 그런데 굳이 각각의 저장소로 여러개의 저장소에 구분을 해야 하는 이유가 있을려나..
그냥 repos 이런식으로 하나의 저장소만을 만들고
그 아래에 디렉토리/폴더로 구분하면 될텐데 말이다...

아무튼 각 저장소별 ./conf 디렉토리에는
passwd / auth / svnserve.conf가 존재하며

svnserve.conf의 주석 몇개와
passwd에 사용자 계정을 추가하면
svn:// 식으로 접속하여 사용이 가능하다.
svn+ssh://은 아직.. OTL


svnserve.conf
### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository.  (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)

### Visit http://subversion.tigris.org/ for more information.

[general]
### These options control access to the repository for unauthenticated
### and authenticated users.  Valid values are "write", "read",
### and "none".  The sample settings below are the defaults.
anon-access = read
auth-access = write
### The password-db option controls the location of the password
### database file.  Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control.  Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file.  If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
# authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.  The default realm
### is repository's uuid.
# realm = My First Repository

[sasl]
### This option specifies whether you want to use the Cyrus SASL
### library for authentication. Default is false.
### This section will be ignored if svnserve is not built with Cyrus
### SASL support; to check, run 'svnserve --version' and look for a line
### reading 'Cyrus SASL authentication is available.'
# use-sasl = true
### These options specify the desired strength of the security layer
### that you want SASL to provide. 0 means no encryption, 1 means
### integrity-checking only, values larger than 1 are correlated
### to the effective key length for encryption (e.g. 128 means 128-bit
### encryption). The values below are the defaults.
# min-encryption = 0
# max-encryption = 256

passwd
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.

[users]
# harry = harryssecret
# sally = sallyssecret
userid = password

위의 경우는 사용자명 userid, 암호가 password인 경우이며,
svn에 수정/삭제 시 아래와 같이 인증을 요구하게 된다.



[참고 : http://www.pyrasis.com/main/Subversion-HOWTO#s-4.3]
Posted by 구차니
cvs2svn 이라는 유틸리티를 사용하면 된다고 한다.

[발견 : http://sam.zoy.org/writings/programming/svn2cvs.html]
[공식 : http://cvs2svn.tigris.org/]

'프로그램 사용 > Version Control' 카테고리의 다른 글

SVN의 단점  (0) 2009.05.08
svn 저장소의 위치  (0) 2009.05.08
TortoiseSVN 내장 Diff 사용시 주의사항 및 프로그램 소개  (2) 2009.03.10
CVS / SVN 차이점?  (2) 2009.03.06
SVN 사용기  (0) 2009.03.05
Posted by 구차니
TortoiseSVN에는 Diff / Merge 툴이 내장되어 있다.
Diff/Merge 프로그램은 외관상으로는 WinMerge와 유사하고, 동일 프로젝트를 변형해서 사용하는게 아닐까라는 생각이 든다.
아무튼 이러한 개인적인 추측은 패스하고~ 장점과 단점을 말하자면 다음과 같다.

   WinMerge  TortoiseMerge
 Syntax Highlight  지원  미지원
 UTF-8 지원  지원  미지원
 네비게이션 부분 확대  미지원  지원


일반적인 소스를 다루는 경우에는 UTF-8 을 굳이 지원해야 할 필요는 없지만,
현재 다국어지원 작업을 하는데 UTF-8을 지원하지 않는 다면 아래와 같이 선택할 경우에 글씨가 깨지는 문제가 발생한다.


TortoiseMerge - 좌측의 네비게이션 부분확대가 매력적이다. (확대해서 비교해 보세요!!)
색상이 있는 줄이 차이점 부분이 확대된 것이고, 아래의 흐릿한 선들이 원래 크기의 차이점 부분표시이다.

WinMerge - 네비게이션을 제외하면 전반적으로 WinMerge가 낫다


구버전의 TortoiseCVS의 경우에는, 기본 비교/병합 프로그램이 없어, 무조건 하나만 입력이 가능한 단점이 있었지만,
TortoiseSVN은 내장 비교/병합 프로그램이 있어서, 사용하지 않더라도 외부 프로그램의 링크는 사라지지 않아 좋다.


남아있는 External Link (화면 배색문제로, 일반적인 pc에서는 회색으로 보임)




또 다른 TortoiseSVN의 내장 비교툴로 IDiff가 있다(Image Diff)
말그대로 이미지를 비교 하는 것인데, I가 굴림체인지라 Diff밖에 눈에 안들어 온다.


위의 이미지가 이미지 비교 프로그램, 아래는 소스 비교 프로그램

이 포스트에 들어간 이미지 a.png와 c.png를 비교한 화면이다

비교 옵션 중 겹쳐보기로 본 비교화면 (Overlay Mode)

비교 옵션 중 혼합 겹쳐보기로 본 비교화면 (Overlay Mode + Alpha Blend)
Posted by 구차니
CVS만 2년 정도 사용했다.
물론 branch 까지는 사용해보지 않았고,
주로 사용하던 기능은 history와 tag 뿐이었다.

아무튼 이렇게 CVS만 쓰다가 SVN을 사용해봤는데,
처음 사용할때의 어색함인지, 상당히 다른 느낌이 든다.

일단 CVS는 module 단위였는데 SVN은 그러한 구분이 없다는 사실.
어쩌면 구형 TortoiseCVS를 사용해서 그럴지도 모르겠다는 생각이 든다.
신형 TortoiseCVS의 경우에는 물론 module단위로 만들기는 하지만,
module 목록을 combobox가 아닌 listbox로 보여 주기 때문에, 기존 버전보다는
확연히 구분되어 있다는 느낌이 적게 들었다.

하지만, SVN은 이러한 '프로젝트'의 느낌보다는, 이력이 남는 '파일 저장소'라는 느낌이 강하게 든다.
(아마 파일 이동의 편의성과, checkout시 URL로 입력하는 특성때문일 것이다)


CVS 구버전 UI

CVS 신버전 UI

Posted by 구차니
UFO:AI 한글화 프로젝트 참여중인데, SVN의 사용은 처음이라 이래저래 적응이 안된다.
가장 큰 것으로는
CVS의 history라는 것이 SVN에서는 Show Log로 바뀌었다는 것이다.
그리고 SVN은 하나의 커밋이나 수정사항이 있을때, 전체의 리비전이 변경되므로,
파일 각각이 아닌 SVN repository 전체에 대한 Log가 존재하게 된다
(사용이 미숙해서 그럴지도 모르지만 TortoiseCVS에서는 파일 단위로 밖에 보지 못했다)

Context-menu 이다. 주로 사용하는 것은
프로젝트 전체의 업데이트인 SVN Update와
프로젝트 전체의 수정 업로드인 SVN Commit 그리고
프로젝트의 변경사항을 볼수 있는 Show Log 이다.

위의 이미지는 프로젝트 전체의 Show Log 결과이다.
프로젝트에서 추가 / 삭제된 파일등과 전체의 Revision이 표기된다.

자막 번역 파일 하나의 내역이다. 자세히 보면 알겠지만, Revision이 1씩 증가하지 않는다.
리비전에서 변동사항이 있을 수도 있고, 없을 수도 있기 때문에, 파일을 Show Log 하면
위와 같이 나오지 않는 사항들을 볼 수 있다.
Posted by 구차니
CollabNet Subversion Server and Client v1.5.5 (for Windows) 를 다운로드 하려면 가입이 필요하다.

설치 화면은 간단한데 svnserve와 apache용 MOD_DAV_SVN을 옵션으로 고를 수 있다.

svn 서버 설정화면으로 포트와 repository를 정해주면 된다.

설치를 완료 하면 자동으로 c:\svn_repository 가 생성된다.
하지만 내용이 하나도 없어서 svn이 접근을 하지 못한다는 에러가 발생한다.

그리고 "Install svnserve to run as Windows service" 일뿐, service가 실행되지는 않는다.
물론 리부팅하면 자동으로 시작이 되긴하겠지만, 설치 직후 안된다면 service가 실행시켜 주면 된다.


authorization failed가 뜨면 아래의 링크를 참조하여 해결하면 된다.

5) Configure permissions for the repository

  • Open with notepad the repository configuration C:\SVNREPOSITORY\conf\svnserve.conf
    and paste just the following lines (remove everything else):
    [general]
    anon-access = none
    auth-access = write
    password-db = passwd.conf
    authz-db = authz.conf
    #realm = My First Repository

    Please note that I renamed "passwd" to "passwd.conf" and "authz" to "authz.conf" both
    in the config file here, and in the filesystem too, so I can just associate the conf extension with notepad and make my life easier.

    Note also that when a realm is not specified, it will be assumed to be the repository guid (created when you created repository). Realms should be unique among different repositories, unless you want to share the same permissions among them.
  • Rename authz to authz.conf
  • Rename passwd to passwd.conf
  • Open passwd.conf with notepad and put some users/passwords by pasting the following lines (remove everything else):
    [users]
    admin = qwerty147
    ricardo = pwd123
    marcelo = pwd456
    joao = pwd789
  • Now open authz.conf with notepad and paste just the following lines (remove everything else):
    # guests will have read permission in all repository
    # writers must include all non-admin users who must have write
    #    permission on some folder (read permission on root is needed for that)
    [groups]
    admins = admin, ricardo
    writers = marcelo
    guests = joao
    project1 = marcelo

    [/]
    @admins = rw
    @writers = r
    @guests = r
    * =

    # please note that permissons (ex: admins group) don't propagate from root to subprojects
    [/Project1]
    @project1 = rw
    @admins = rw
    * =
  • Now you can try again mkdir:
    C:\>svn mkdir svn://localhost/Products
    Authentication realm: e9852c7c-f11f-1946-b4a8-49fa8b53a267
    Password for 'Ricardo': ******


    Please note that it will by default assume your username is the same as your windows login. If it is not, just put any password, and it will ask you for your correct username.
  • If everything went ok you will get a message like "Committed revision 1"

    Congratulations! You have made your first change to the repository.

    Now let's create another folder: C:\> svn mkdir svn://localhost/Projects
    The password won't be asked this time, because it's cached for your user (Documents and settings\username\Application Data\Subversion\auth\)

[출처 : http://www.smarter-technologies.com/smarter/Default.aspx?tabid=128&EntryID=12]

svn_repository의 내부 구조 & conf 내용물들

svnserve.conf의 기본 내용. 전부 주석처리다 ㄱ-

passwd는 사용하는 계정에 대한 아이디/암호를 저장한다.

이녀석은.. 아무튼 인증파일이다. 특정 리파지터리에 특정 유저의 권한을 설정한다.



심심해서 해본 뻘짓

[다운로드 : http://www.collab.net/downloads/subversion/] <- 가입필요
[다운로드 : http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91]

'프로그램 사용 > Version Control' 카테고리의 다른 글

CVS / SVN 차이점?  (2) 2009.03.06
SVN 사용기  (0) 2009.03.05
TortoiseSVN 사용하기  (2) 2009.02.26
TortoiseSVN - Svnserve Based Server  (5) 2009.02.26
cvs 서버 설치 / 복원  (2) 2009.01.22
Posted by 구차니