프로그램 사용/eclipse2014. 5. 18. 18:55
sublclipse와 subversive는 별반 차이가 없어 보이나..
내부적으로 많이 다른것 같은 느낌...?


일단 subversive는 subclipse에서 JavaHL을 통해 Native하게 C언어를 끌어와서 하는것 같고
그 기반으로 JavaHL(High Language) / JNA(Java Native Access)를 이용하는 것으로 생각된다.

음.. subclipse와 subversive의 외관상의 차이는...
subversive 에는 단축키가 할당되고
subclipse 에는 단축키가 없다는 것과

checkout 시에 미묘한 차이가 있다는 것 정도?

subclipse의 단축키가 없는 모습


subversive의 단축키 모습. 그리고 아이콘도 촘촘히 존재한다.


아무트 설치과정은
Subversive 설치 후


리부팅시에 맞는 버전에 따라 (귀찮으니 그냥 JavaHL 32bit/64bit로 하면 됨) 설치한다.


[링크 : http://subclipse.tigris.org/wiki/JavaHL] JavaHL
[링크 : http://en.wikipedia.org/wiki/Java_Native_Access] JNA
[링크 : http://www.eclipseonetips.com/.../eclipse-shortcuts-for-common-svn-commands/]  이클립스 단축키 설정
[링크 : http://www.eclipse.org/subversive/index.php] subvesive
[링크 : http://stackoverflow.com/questions/553133/subclipse-with-svnkit-adapter ] SVNKit Connector
Posted by 구차니
구글 코드에서는 svn이나 cvs 등의 서비스를 무료로 제공한다.
[링크 : https://code.google.com/]

일단 가입은 구글 계정이 있어야 하고 프로젝트 생성을 하면 프로젝트 이름이 서브 도메인으로 지정되어 접속이 가능해진다.


접속 경로를 알기 위해서는 Checkout 클릭


자신의 SVN 암호를 알기 위해서는 googlecode.com password를 클릭


본인이 사용할 암호이고 절대 공개되서는 안될 내용이다.
아무튼.. 이 내용은 프로젝트가 아닌 사용자 별로 지정이 되는 것으로 생각된다.


eclipse에서 subclipse에 대한 repository를 추가해서 하거나
marketplace에서 subclipse로 검색을 하면된다.
SVNKit은 굳이 설치할 필요는 없고, marketplace에서 추가시에는 SVNKit 항목이 존재하지 않는다.


설치 후에는 Perspective를 열어준다.


빈곳에서 New - Repository Location


위에서 생성했던 구글 코드의 경로를 입력한다.
trunk로 해도 되고 trunk 아래에 프로젝트 폴더를 새로 만들어도 되고.. 마음대로 운영


사용하려면 일단 저장소에서 소스를 받아와야 하는데 checkout을 통해 받아온다.


프로젝트 위저드를 하는건 아직 방법을 모르겠으니.. 일단
프로젝트로 워크스페이스에 받도록 한다.
trunk를 상위 폴더로 svn 경로 설정되어 있기에 자동으로 프로젝트 이름이 trunk로 뜨나
임의 수정은 가능하니 적절하게 변경해준다.


귀찮으니 걍 다음.


https 임에도 불구하고 로그인은 아직 뜨지 않는다.
나중에 commit이나 remote folder 생성같은 원격지 로그인이 필요한 작업시에
로그인이 뜨게 되는데.. 일단 테스트 삼아 원격지 폴더를 생성궈궈


trunk/test 폴더를 만듭니돠


tortoiseSVN 처럼 왜 이걸 하는지 이유를 comment로 달아주고


생성하려고 하면 계정과 암호를 묻는데
구글아이디가 username이고 비밀번호는 상단의 구글 코드에서 확인한 자동생성된 코드를 입력한다.


---
2014.05.10 추가

프로젝트 생성후 공유하기 위해서는
Team - Share Proejct


위에서 SVN으로 했기에 SVN으로 선택


소스 서버 추가 되어 있다면 선택을, 그게 아니라면 추가를 해주고


원하는 폴더명으로 프로젝트를 올리도록 한다.


초기 업로드용이므로 적당한 멘트를 적는데


윗단계에서 Synchronize manager 어쩌구 쩌서 취소했더니
실제로 commit 되진 않았고 별도로 Team - Commit을 통해 업로드를 해주었다.

---

나머지는.. 프로젝트 탐색기로 돌아와서
Team 아래의 commit / update / histroy 등으로 프로젝트 전체를 SVN를 통해 사용하면 된다. 


이번은 로컬에서 test 폴더를 만들고 commit해서 서버에 적용해보는데 잘~된다


일단.. TortoiseSVN이 설치되어 있기 때문에
프로젝트 폴더 자체가 SVN으로 접속이 가능하고 maven으로 관리 받는
"Dynamic web Project" 임에도 불구하고 다른 컴퓨터에서 프로젝트를 받아 제대로 maven 연동되는 것을 확인했다. 


[링크 : http://subclipse.tigris.org/] subclipse
[링크 : http://pallandri.blogspot.kr/2014/01/using-subclipse-with-eclipse-and.html]

Posted by 구차니
만약에 2개의 장소에서 독립적인 지역 저장소(local repositories)를
하나의 중앙 서버에서 합쳐서 서비스를 하려고 한다는 상황에 적절한 내용

--- 2011.05.11 추가
병합된 내용을 보니 날짜 / 시간별로 revision이 맞물려 들어간다.
---

# svnadmin load --help
load: 사용법: svnadmin load REPOS_PATH

stdin 으로 'dumpfile' 형식의 스트림을 읽어들여, 새로운 리비젼을
저장소의 파일시스템으로 커밋합니다. 이전에 저장소가
비어있었다면, 기본적으로 그것의 UUID 가 스트림에 지정된
한가지로 변경될것입니다. 진행 피드백은 stdout 으로 전송됩니다.

옵션:
  -q [--quiet]             : stderr 에 대한 진행사항이 (오류에 한해서) 없습니다
  --ignore-uuid            : 스트림에 어떤 repos UUID가 발견되어도 무시합니다
  --force-uuid             : 만약 있다면, repos UUID 를 스트림에서 발견된 것에 설정합니다,
  --use-pre-commit-hook    : 리비전을 새로이 커밋하기 전 post-commit 훅을 호출합니다.
  --use-post-commit-hook   : 리비전을 새로이 커밋한 뒤 post-commit 훅을 호출합니다.
  --parent-dir ARG         : 저장소의 지정된 디렉토리에 로드합니다

# svnadmin dump --help
dump: 사용법: svnadmin dump REPOS_PATH [-r LOWER[:UPPER] [--incremental]]

파일 시스템의 내용을 stdout으로 포터블한 형식의 'dumpfile'로 출력하며,
stderr로 피드백을 보냅니다. 리비젼 LOWER부터 UPPER까지 출력합니다.
주어진 리비젼이 없다면, 모든 리비젼 트리를 적재합니다. LOWER만 주어졌다면,
LOWER 값에 해당하는 리비전만 출력합니다.
--incremental 옵션을 사용한다면, 출력되는 첫번째 리비전에는 해당
리비전에서 바뀐 경로에 대한 것만 기술될 것이며, 그렇지 않은 경우에는
해당 리비전에 존재하는 모든 경로가 출력됩니다.
(이 옵션의 사용여부에 상관없이 출력되는 두번째 이후의 리비전에는 해당
리비전에 바뀐 내용이 있다면, 그 경로의 내용만 출력됩니다)

옵션:
  -r [--revision] ARG      : 리비젼 넘버 ARG ( 또는 X:Y 범위 )를 지정합니다
  --incremental            : incremental 적재를 합니다.
  --deltas                 : 적재된 결과물에 deltas를 사용합니다
  -q [--quiet]             : stderr 에 대한 진행사항이 (오류에 한해서) 없습니다

$ svnadmin dump repo1 > a1.d
$ svnadmin dump repo2 > a2.d
$ svnadmin create new
$ svn mkdir file:///.../new a1
$ svnadmin load new --parent-dir a1 < a1.d
$ svn mkdir file:///.../new a2
$ svnadmin load new --parent-dir a2 < a2.d 

[링크 : http://spyced.blogspot.com/2007/09/merging-two-subversion-repositories.html] 

간단하게 요약하자면
repo1 의 내용을 a1.d 에 
repo2 의 내용을 a2.d 에 파일로 저장하고

new라는 새로운 저장소를 만들어
그 안에 repo1은 a1 이라는 상위 디렉토리를 넣어주고
repo2는 a2 라는 상위 디렉토리를 넣어준다.

만약, 특별한 상위 디렉토리 없이 전부를 넣어주고 싶다면
--parent-dir /
이라고 해주면 목적지 저장소의 / 에 전부 넣어지게 된다.
(실험해보진 않았지만 parent는 저장소의 지정된 디렉토리 이므로,
엄밀하게는 미리 디렉토리를 생성해주고 그 안으로 넣어도록 지정이 가능할 것으로 보인다.)

[링크 : http://geekswithblogs.net/kariemali/archive/2009/06/02/how-to-merge-two-svn-repositories.aspx]
[링크 : http://stackoverflow.com/questions/267256/combining-multiple-svn-repositories-into-one]
Posted by 구차니
우분투에서 apache2는 기본값으로 www-data:www-data 유저/그룹으로 실행된다.

보안이랑은 좀 거리가 멀어지는 느낌이지만, www-data 유저를 shadow 그룹으로 넣고
<Location /svn/repos1>
        DAV svn
        SVNPath /home/svn/repos1

        AuthPAM_Enabled on
        AuthType Basic
        AuthName "Subversion Repository"
        AuthUserFile /etc/shadow
        Require group www-data
        Require valid-user
</Location>
위와 같이 설정을 해주니, shadow의 로그인 정보를 이용하여 svn에 접근할수 있게 되었다.


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

svn export 와 checkout의 차이점  (0) 2010.11.18
svn blame  (4) 2010.11.18
Apache + SVN on Ubuntu 10.04  (0) 2010.11.03
visualSVN  (0) 2010.09.09
TortoiseSVN tag/branch = copy  (2) 2010.04.30
Posted by 구차니
오프라인에서도 마지막에 서버에서 받은 것과 diff 할 수 있다!

2010.02.02 추가
(cvs에서는 온라인이 아니라면 비교해 볼수도 없다.)
2009/05/08 - [프로그램 사용/SVN/CVS] - SVN의 단점

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 구차니