开发者

Does Mercurial create a server process when you create a local repository?

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, 开发者_如何学Pythonright? 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 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.


There is no server process, the binary is indeed doing all the work. That's DVCS: You're working locally; your project directory is working directory and repository at the same time.

Until you start sharing your code, there's no server anywhere.


This pretty much does the trick. But, what server process are you referring to?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜