IT박스

Mercurial "서버"

itboxs 2020. 10. 24. 09:55
반응형

Mercurial "서버"


Mercurial을 잠시 동안 사용해 왔지만 주로 내 용도로 사용했습니다. 하지만 지금은 우리 둘이 같은 프로젝트를 만들고있는 프로젝트가 있는데, 아마 서로의 파일을 수정할 것입니다.

서버에 Mercurial 저장소를 설정하고 해당 저장소를 "서버"로 만들고 싶습니다. 그래서 저의 변경 사항과 다른 편집자의 변경 사항은 모두 해당 서버에 푸시됩니다 (기본적으로 Subversion / CVS 모델). 나는 Mercurial을 좋아하고 Subversion과 같은 것으로 전환하고 싶지 않습니다.

여기 내 네트워크에서 모든 것이 Linux에서 이루어지며 내 "서버"에는 OpenSSH가 설치되어 있습니다. 따라서 한 컴퓨터에서 서버로 변경 사항을 푸시 (여러 컴퓨터에서 작업)하는 것은 "hg push"의 문제 일뿐입니다. 사용되는 프로토콜 은 변경 사항을 전송하기위한 SSH 입니다.

문제는 내가 Linux를 사용하고 서버가 Windows (OpenSSH가 아님)가되고 다른 편집기도 Windows를 사용한다는 것입니다. 내가 아는 한 이러한 유형의 설정에서 Mercurial에서 작업하는 가장 좋은 방법은 소스가 "서버"로 푸시되는 것이 아니라 소스에서 변경 사항을 가져 오는 것입니다. 저는 여러 방화벽 (전적으로 내 네트워크가 아님) 뒤에 있고 내 컴퓨터가 서버에서 보이지 않으며 다른 편집기도 방화벽 뒤에 있다고 가정합니다 (따라서 로컬 Mercurial을 시작할 수는 없습니다). HTTP 서버에서 "서버"컴퓨터를 가져옵니다).

두 편집자가 서버 저장소에 변경 사항을 가져 오는 가장 좋은 방법은 무엇입니까? (서버가 인터넷에있는 서버라고 추가해야하므로 google.com. 과 같이 볼 수 있습니다 . 호스팅 된 Windows 서버이지만 필요한 경우 소프트웨어를 설치할 수있는 권한이있을 것입니다.)


www.fogbugz.com에서 Kiln을 제안합니다. 이것은 상용 소스 제어 솔루션으로 기본적으로 Mercurial이 포함 된 Windows 래퍼입니다.


프로젝트 문서를 읽는 것이 좋은 시작이라고 생각합니다 : https://www.mercurial-scm.org/wiki/PublishingRepositories .


또한 관리를 단순화하여 아웃소싱 할 수 있습니다. 저장소가 하나만 있고이를 푸시 / 풀링하는 두 사람 만 있다면 Bitbucket 같은 곳에서 호스팅하는 것보다 훨씬 더 나쁜 일을 할 수 있습니다. (그리고 단일 저장소 솔루션의 경우 실제로 무료입니다.)


코드 검색을 포함하여 Kiln이 제공 하는 많은 기능을 갖춘 오픈 소스 Mercurial 서버 인 rhodecode를 살펴보십시오 . LDAP와 잘 통합되므로 Windows 도메인으로 HG 사용자를 인증 할 수 있습니다.


Mercurial 저장소 호스팅 사이트 인 http://bitbucket.org/에 프로젝트를 올리는 것이 좋습니다 . 다른 사람이 소스를 보지 못하도록하려면 개인 저장소를 만들 수있는 설정이 있습니다. 비용을 청구하기 전에 하나의 개인 저장소가 허용되는 것 같습니다.

편집 : Bitbucket은 이제 무제한 비공개 / 숨겨진 저장소를 제공 합니다.


확실히 Windows에서 사용할 수있는 SSH 서버가 많이 있습니다. 다음은 두 가지 예입니다.

Mercurial : The Definitive Guide 책에서 Windows 사용자 연결을위한 Putty 예제를 확인하십시오 .


SCM-Manager사용 하여 http 또는 https를 통해 리포지토리를 공유 할 수 있습니다 .


Mercurial과 PuTTY 는 잘 지원되고 잘 문서화 된 솔루션입니다.


가장 간단한 해결책은 특히 Windows 전용 환경에서 Samba 공유 폴더를 사용하는 것 같습니다. 방금 설정했는데 작동하는 것 같습니다.


직접 사용하지는 않았지만 LShift의 Mercurial Server살펴 보겠습니다 .


설정 : Windws 서버 + Apache + Mercurial

http.conf의 일부

<Location /hg>

    DirectoryIndex hgweb.cgi #from mercurial source, put it in htdocs/hg
    AddHandler cgi-script .cgi
    Options ExecCGI
    Options +FollowSymLinks
        Order deny,allow
        Deny from all
        <Limit GET POST>
            Allow from 127.0.0.1 10.1.2 
        </Limit>   

    AuthUserFile D:/hg/htpasswd
    AuthGroupFile D:/hg/hggroups
    AuthType Basic
    AuthName "Mercurial xxxx repositories"

    Require group admin somegroup

    RewriteBase /hg
    RewriteRule ^$ hgweb.cgi  [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.*) hgweb.cgi/$1  [QSA,L]  
</Location>

<Location /hg/project1>    
    Require group somegroup admin
</Location>
<Location /hg/project2>    
    Require group somegroup admin
</Location>
<Location /hg/test>    
    Require valid-user
</Location>

hgweb.conf / htpasswd / hggroups와 같이 설정할 다른 파일이 있지만 쉬운 부분입니다.

꽤 잘 작동하고 있습니다. 사용자가 암호를 변경하려는 경우 온라인 htpasswd 생성기로 가서 htpasswd 시퀀스를 생성하도록 요청하고 htpasswd 파일에 넣습니다.

우리의 설정은 VisualSvn Server가하는 것과 매우 유사하다고 생각합니다. (물론 훨씬 단순화 된 버전)


Share a Dropbox folder that contains your 'server repository'.


As far as I know, the best way of working in mercurial in these types of setups is for the repo to pull changes from the source, rather then the source pushing to the "server".

There is no "best way of working" that I know of? There's a multitude of possible work flows that Mercurial supports, and the even list them in their guide. I'm actually using the "svn-ish" set-up, where I develop in a local repository, and have several repositories on a shared server. If there are any changes, I push them into the central repository. I push them over HTTPS, and I've (naturally) limited push abilities to developers only. It's a great way of working.

I can understand people want the central repository to pull the changes over from the clones the developers made, but there is nothing stopping you giving yourself and your co-worker a dedicated repository on the shared server, from which the central repository is able to pull.

You might want to reconsider your thoughts on the matter pushing v pulling?

참고URL : https://stackoverflow.com/questions/740075/mercurial-server

반응형