Mercurial’s website says about creating a project this way:
Create a project and commit
$ hg init (project-directory)
$ cd (project-directory)
$ (add some files)
$ hg add
$ hg commit -m 'Initial commit'
I need a single user, local repository. I assume this does the trick, right? The thing I don’t understand is:will it open a server process, or is the hg binary doing all the work each time it is called?
The
hgbinary is doing all the work each time it is called.hgdoesn’t really need a server. You can create one really easily using thehg servecommand, but that’s more for interacting with other people than anything else, and by default it doesn’t allow write access.Mercurial survived for a long time with a server that didn’t allow write access. A decentralized VC system really doesn’t need one, or at least it’s not anywhere near the absolute requirement it would be with a centralized system. Everybody just writes to their local repository and then advertises their changes for other people (like the maintainer of the ‘official’ tree) to pull.
In fact, even if there is a central server you can push to, you always commit your changes to your local repository before you push them. The push is more like syncing up a database than it is like the commit you would think of if you’re used to things like Subversion or Perforce.
Mercurial looks for a directory called
.hgin the current directory, or a parent directory, or a parent of the parent, etc… to determine if it’s in a Mercurial repository. Thehg initcommand will work for users with no administrative privileges whatsoever.