Mercurial "server"
Asked Answered
L

14

75

I've been using Mercurial for a little while, but mainly for my own use. Now though, I have a project I'm working on where two of us are building the same project, and we will probably be modifiying each other's files.

I would like to setup a Mercurial repository on a server, make that repository the "server", so my changes and the other editor's changes both push to that server (so basically the Subversion / CVS model); I like Mercurial though and don't want to switch to something like Subversion.

Here in my own network, everything is done on Linux, and my "server" has OpenSSH installed. So pushing my changes (I work on multiple computers) from one computer to the server is just a matter of "hg push"; the protocol used is SSH for transfering the changes.

The problem is that I use Linux, the server will be Windows (so no OpenSSH, right?) and the other editor will be using Windows too. As far as I know, the best way of working in Mercurial in these types of setups is for the repository to pull changes from the source, rather then the source pushing to the "server". I'm behind several firewall's (not entirely my network) and my computer won't be visible from the server, and I'm assuming the other editor will be behind a firewall too (so we can't just start up the local Mercurial HTTP server and get the "server" computer to pull from that).

What's the best way for both editors to get our changes to the server repository? (I should add that the server is a server on the Internet, so it is just as visible as something like google.com. It's a hosted Windows server, but I would probably have permission to install software if needed for this.)

Latrinalatrine answered 11/4, 2009 at 13:21 Comment(0)
V
11

I suggest Kiln from www.fogbugz.com. It's a commercial source control solution, basically a Windows wrapper with Mercurial under the hood.

Update 2020-10-24

11 years ago, Mercurial might have been a viable solution, but not any more: Git just works.

Vermilion answered 31/5, 2010 at 15:44 Comment(7)
Please see my comments to mizipzor and Alistair Bell.Latrinalatrine
I am afraid that you don't understand what Kiln offering by Fogcreek entails. Kiln is not a hosted service - to be fair, you can use FogCreek provided hosted service if you like, but Kiln is an autonomously installable server software. (All the gritty details of pricing are discussed on this page -- fogcreek.com/Kiln/Details.html#forYourServer )Babi
I'd suggest you don't understand what the Kiln offering by Fogcreek entails. I purchased and installed Kiln on our Amazon EC2 server, and its running nicely right now. Its just a very nice wrapper around Mercurial.Vermilion
You're right, didn't realize kiln could be installed on my own server. Thanks for the tip.Latrinalatrine
How long until Kiln has a free version, like VisualSVN?Elwood
Check rhodecode.org its a open source mercurial server with many of the features kiln has (although not all).Petaliferous
If only RhodeCode could be easily installed on a Windows box.Sension
P
50

I believe reading the project's documentation is a nice start: https://www.mercurial-scm.org/wiki/PublishingRepositories.

Prediction answered 11/4, 2009 at 14:3 Comment(0)
H
19

It might also simplify the administration to outsource it -- if you only have one repository and a couple of guys pushing/pulling it, you could do a lot worse than just hosting it somewhere like Bitbucket. (And for a one-repository solution it's actually free.)

Update: It is 2020 now and Bitbucket no longer supports mercurial, see: https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket

For a list of hosted or self hosted free or paid solutions see https://www.mercurial-scm.org/wiki/MercurialHosting

Hornstein answered 22/5, 2009 at 17:21 Comment(3)
Sure it would. BitBucket has the concept of private repos, which the rest of the world can't see (they can't even see that it's there). If you're sufficiently paranoid that putting your code on a machine somebody else owns is a problem, fair enough; but for everyone else, it's quite doable.Hornstein
@TJ, not if you explain how much of their time you'll spend figuring out how to manage your own central repo.Mockery
Who is TJ? Did (s)he delete his/her comment(s)?Phytography
P
16

Take a look at rhodecode it's a open source Mercurial server with many of the features that Kiln offers, including code search. It even integrates nicely with LDAP so you can authenticate HG users with your Windows domain.

Petaliferous answered 27/10, 2011 at 10:21 Comment(3)
I had a look at this. It's a nice system. You need to get your head around running a python app, but it wasn't to hard. I couldnt fugure out howto run it as a Windows Service thoughMunsey
There is an open source version of Rhodecode. It is now called Kallithea. pythonhosted.org/KallitheaDipterocarpaceous
RhodeCode (and other company projects) are open-source actually. Please check code.rhodecode.com for a full list. There a lot of added functionality in 4.X series of RhodeCode that are not in Kallithea too, like diff syntax highliting, pull-request merges, smart code reviews etc...Shoshonean
G
14

Update: It is 2020 now and Bitbucket no longer supports mercurial, see: https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket

For a list of hosted or self hosted free or paid solutions see https://www.mercurial-scm.org/wiki/MercurialHosting

I recommend putting your project on http://bitbucket.org/, a Mercurial repository hosting site.

If you don't want the source to be seen by others they have settings to create private repositories. I think you're allowed one private repository before they start charging you for it.

Edit: Bitbucket now provides unlimited private/hidden repositories.

Grecian answered 31/5, 2010 at 15:48 Comment(6)
I don't think you understand commercial development practices; there is no way that raw source code from this company is going to be hosted on somebody else's server, regardless of whatever "private" repositories exist. It's just not an option.Latrinalatrine
Commercial doesn't imply ignorance.Mockery
@Chris: different companies have different paranoia levels, and that's fine. If 85116 can't persuade his company to outsource this stuff to BitBucket or Fog Creek (some will, some won't) his best option will probably be to buy a copy of Kiln that he can run locally. Personally I'd outsource, but in many companies that goes in the 'too hard politically' bucket.Hornstein
Wow, talking about ignorance... some of you just don't get it. Please read Alistair's comment above again, and again, and ...Latrinalatrine
-1 only because it's a duplicate answer https://mcmap.net/q/268802/-mercurial-quot-server-quot/…Abstractionist
I would never outsource closed source code. I cannot see why security should be the same as paranoia.Phytography
V
11

I suggest Kiln from www.fogbugz.com. It's a commercial source control solution, basically a Windows wrapper with Mercurial under the hood.

Update 2020-10-24

11 years ago, Mercurial might have been a viable solution, but not any more: Git just works.

Vermilion answered 31/5, 2010 at 15:44 Comment(7)
Please see my comments to mizipzor and Alistair Bell.Latrinalatrine
I am afraid that you don't understand what Kiln offering by Fogcreek entails. Kiln is not a hosted service - to be fair, you can use FogCreek provided hosted service if you like, but Kiln is an autonomously installable server software. (All the gritty details of pricing are discussed on this page -- fogcreek.com/Kiln/Details.html#forYourServer )Babi
I'd suggest you don't understand what the Kiln offering by Fogcreek entails. I purchased and installed Kiln on our Amazon EC2 server, and its running nicely right now. Its just a very nice wrapper around Mercurial.Vermilion
You're right, didn't realize kiln could be installed on my own server. Thanks for the tip.Latrinalatrine
How long until Kiln has a free version, like VisualSVN?Elwood
Check rhodecode.org its a open source mercurial server with many of the features kiln has (although not all).Petaliferous
If only RhodeCode could be easily installed on a Windows box.Sension
S
8

There are certainly many SSH servers available for Windows. Here are two examples:

Check out the Putty examples in the Mercurial: The Definitive Guide book for the Windows user connectivity.

Strander answered 13/4, 2009 at 21:1 Comment(0)
R
7

You could use SCM-Manager to share your repositories over http oder https.

Ramunni answered 3/2, 2011 at 8:28 Comment(2)
"Repository not found You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated."Phytography
The project is no longer on BitBucket it is moved to GitHub (github.com/scm-manager/scm-manager). I have changed the answer and the link now points to the homepage (scm-manager.org) of the project.Ramunni
M
5

Mercurial and PuTTY is a well supported and a well documented solution.

Mill answered 11/4, 2009 at 13:47 Comment(1)
Where is it "well documented"? If you don't even have a link, it probably won't be true....Phytography
E
3

The simplest solution seems to be to use Samba shared folders, especially in Windows-only environment. I've just set it up, seems to work.

Euratom answered 19/2, 2010 at 17:43 Comment(1)
Thats the same solution we use in my team.Grecian
S
2

I've not used it myself but do take a look at Mercurial Server by LShift.

Sorcerer answered 14/4, 2011 at 13:24 Comment(0)
I
2

Our setup: Windws server + Apache + Mercurial

Part of our 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>

There are other files to setup, like hgweb.conf/htpasswd/hggroups, but they are the easy part.

It has been working pretty nicely. If any user wants to change password, I'll ask him to go to an online htpasswd generator to generate the htpasswd sequence for me, I'll put it in the htpasswd file.

I think our setup is quite similar to what VisualSvn Server does. (of course, a much simplified version)

Intermediary answered 9/12, 2011 at 6:16 Comment(0)
B
1

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

Bemba answered 12/8, 2010 at 8:59 Comment(1)
Why not ditch sharing at all? It's useless in the end.Costumier
T
0

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?

Tory answered 14/1, 2011 at 8:23 Comment(0)
C
0

In 2020 you can use heptapod:

https://about.heptapod.host/

This is a solution based on gitlab. They offer a hosted solution but you can also download it and host on your own infrastructure.

https://heptapod.net/heptapod-commercial-service-enters-free-public-beta.html#heptapod-commercial-service-enters-free-public-beta

Contribution answered 24/10, 2020 at 6:4 Comment(1)
Haven't got no budget. :(Phytography

© 2022 - 2024 — McMap. All rights reserved.