The hg
binary is doing all the work each time it is called.
hg
doesn't really need a server. You can create one really easily using the hg serve
command, 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 .hg
in the current directory, or a parent directory, or a parent of the parent, etc... to determine if it's in a Mercurial repository. The hg init
command will work for users with no administrative privileges whatsoever.