'cvs2svn'에 해당되는 글 3건

  1. 2010.04.23 cvs2svn 사용방법 2
  2. 2009.05.10 cvs2svn 사용방법
  3. 2009.04.09 CVS 에서 SVN으로 저장소 이전하기 2
예전글에서 프로젝트 리비전을 분할관리 해야할 것 같아서 다시 한번 시도를 해봤는데 아래와 같은 내용이 있었다.

USAGE:
cvs2svn [OPTIONS]... [-s SVN-REPOS-PATH|--dumpfile=PATH|--dry-run] CVS-REPOS-PATH
cvs2svn [OPTIONS]... --options=PATH
CVS-REPOS-PATH The filesystem path of the part of the CVS repository that you want to convert. It is not possible to convert a CVS repository to which you only have remote access; see the FAQ for details. This doesn't have to be the top level directory of a CVS repository; it can point at a project within a repository, in which case only that project will be converted. This path or one of its parent directories has to contain a subdirectory called CVSROOT (though the CVSROOT directory can be empty).
Configuration via options file
--options=PATH Read the conversion options from the specified file. See section options file method for more information.
Output options
-s PATH
--svnrepos PATH
Write the output of the conversion into a Subversion repository located at PATH. This option causes a new Subversion repository to be created at PATH unless the --existing-svnrepos option is also used.

[링크 : http://cvs2svn.tigris.org/cvs2svn.html]



예를들어
/home/cvs
|-- CVSROOT
|-- Project1
|-- Project2
`-- Project3
이런구조의 cvs repository라면,

$ cvs2svn --svnrepos /home/svn/ --encoding=cp949 /home/cvs/
으로 할경우, 리비전이 전부 하나로 묶이고, 프로젝트가 분리되지 않는다.

$ cvs2svn --svnrepos /home/svn/Project1 --encoding=cp949 /home/cvs/Project1
$ cvs2svn --svnrepos /home/svn/Project2 --encoding=cp949 /home/cvs/Project2
$ cvs2svn --svnrepos /home/svn/Project3 --encoding=cp949 /home/cvs/Project3
이렇게 하면 개별 프로젝트로 repository가 생성이 된다.
(부가적으로 revision이 단순해져서 변환도 상대적으로 빨라지는 듯하다)

2009/05/10 - [프로그램 사용/CVS / SVN / GIT] - cvs2svn 사용방법

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

visualSVN  (0) 2010.09.09
TortoiseSVN tag/branch = copy  (2) 2010.04.30
svn / svnadmin 도움말  (0) 2010.04.23
CVS / SVN 장단점, 차이점 비교  (6) 2010.04.07
GIT는 리눅스에서 받으시는걸 추천합니다.  (0) 2010.03.18
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 구차니
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 구차니