Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Mercurial Server a must for using Mercurial?

I am trying to pick a version control software for our team but I don't have much experience for it before. After searching and googling, it seems Mercurial is a good try. However, I am a little bit confused about some general information about it. Basically, our team only have 5 people and we all connect to a server machine which will be used to store the repositories. The server is a Redhat Linux system. We probably use a lot of the centralized workflow. Because I like the local commit idea, I still prefer the DVCS kind software. Now I am trying to install mercurial. Here are my questions.

1) Does the server used for repositories always need to be installed the software "mercurial-server "? Or it depends on what kind of workflow it uses ? In other words, is it true if there is no centralized workflow used for works, then the server can be installed by "mercurial client" ?

I am confused about the term "mercurial-server". Or it means the mercurial installed on the server is always called "mercurial server" and it does matter if it is centralized or not. In addition, because we all work on that server, does it mean only one copy of mercurial is required to install there ? We all have our own user directory such as /home/Cassie, /home/John,... and /home/Joe.

2) Is SSH a must ? Or it depends on what kind of connection between users and the server ? So since we all work in the server, the SSH is not required right ?

Thank you very much,

like image 855
Cassie Avatar asked Sep 22 '11 18:09

Cassie


People also ask

Does anyone use mercurial?

According to Chan, less than 1 per cent of new Bitbucket users choose Mercurial as their version control system. And she cites data from StackOverflow's 2018 Developer Survey that's no less damning: 87 per cent of developers use Git and only about 4 per cent user Mercurial.

Who is using Mercurial?

It still has a handful of large development organizations using it — including Facebook, Mozilla, and World Wide Web Consortium (W3). But it only has about 2% of the VCS market share.

What is HG repository?

Strictly speaking, the term repository refers to the directory named . hg (dot hg) in the repository root directory. The repository root directory is the parent directory of the . hg directory. Mercurial stores its internal data structures – the metadata – inside that .


3 Answers

There are two things that can be called a "mercurial server".

One is simply a social convention that "repository X on the shared drive is our common repository". You can safely push and pull to that mounted repository and use it as a common "trunk" for your development.

A second might be particular software that allows mercurial to connect remotely. There are many options for setting this up yourself, as well as options for other remote hosting.

Take a look at the first link for a list of the different connection options. But as a specific answer to #2: No, you don't need to use SSH, but it's often the simplest option if you're in an environment using it anyways.

The term that you probably want to use, rather than "mercurial server", is "remote repository". This term is used to describe the "other repository" (the one you're not executing the command from) for push/pull/clone/incoming/outgoing/others-that-i'm-forgetting commands. The remote repository can be either another repository on the same disk, or something over a network.

like image 165
jkerian Avatar answered Sep 29 '22 02:09

jkerian


Typically you use one shared repository to share the code between different developers. While you don't need it technically, it has the advantage that it is easier to synchronize when there is a single spot for the fresh software.

In the simplest case this can be a repository on a simple file share where file locking is possible (NFS or SMB), where each developer has write access. In this scenario there is no need to have mercurial installed on the server, but there are drawbacks:

  • Every developer must have a mercurial version installed, which can handle the repo version on the share (as an example, when the repo on the share is created with mercurial 1.9, a developer with 1.3 can't access this repo)
  • Every developer can issue destructive operations on the shared repo, including the deletion of the whole repo.
  • You can't reliably run hooks on such a repo, since the hooks are executed on the developer machines, and not on the server

I suggest to use the http or ssh method. You need to have mercurial installed on the server for this (I'm not taking the http-static method into account, since you can't push into a http-static path), and get the following advantages:

  • the mercurial version on the server does not need to be the same as the clients, since mercurial uses a version-independent wire protocol
  • you can't perform destructive operations via these protocols (you can only append new revisions to a remote repo, but never remove any of them)

The decision between http and ssh depends on you local network environment. http has the advantage that it bypasses many corporate firewalls, but you need to take care about secure authentication when you want to push stuff over http back into the server (or don't want everybody to see the content). On the other hand ssh has the drawback that you might need to secure the server, so that the clients can't run arbitrary programs there (it depends on how trustworthy your clients are).

like image 40
Rudi Avatar answered Sep 29 '22 01:09

Rudi


I second Rudi's answer that you should use http or ssh access to the main repository (we use http at work).

I want to address your question about "mercurial-server".

The basic Mercurial software does offer three server modes:

  1. Using hg serve; this serves a single repository, and I think it's more used for quick hacks (when the main server is down, and you need to pull some changes from a colleague, for example).
  2. Using hgwebdir.cgi; this is a cgi script that can be used with an HTTP server such as Apache; it can serve multiple repositories.
  3. Using ssh (Secure Shell) access; I don't know much about it, but I believe that it is more difficult to set up than the hgwebdir variant

There is also a separate software package called "mercurial-server". This is provided by a different company; its homepage is http://www.lshift.net/mercurial-server.html. As far as I can tell, this is a management interface for option 3, the mercurial ssh server.

So, no, you don't need to have mercurial-server installed; the mercurial package already provides a server.

like image 38
daniel kullmann Avatar answered Sep 29 '22 01:09

daniel kullmann