Is there a real advantage using a web server for Mercurial repositories?

北城余情 提交于 2019-12-11 14:49:05

问题


I am a remote worker and I have VPN access to a Windows file server share. It seems that everywhere I read that the recommendation is to use a Web server based repository. It would be a tough sell for me because I don't know the real advantages to weigh against the cost of maintaining a web server whether it is a Windows or Linux based.

There would only be two people accessing it at this time and neither would need access outside the VPN or the main office. Someday maybe more. but not in the foresable future.


回答1:


I'd like to add my 2 cents as well - the PublishingRepositories page linked by Martin says the following about server shares:

generally restricted to intranets, not generally recommended due to general issues with network filesystem reliability

From my own experience, putting HG repositories on server shares works on Windows as long as the clients and the server are Windows machines.

I had problems at home with Windows clients trying to access HG repositories on a NAS running on Linux.

At work, we used HG repositories on a share on a "real" Windows server for over 3 years without a single problem.
In the meantime, we switched to hgweb - I had to move to a new server anyway, so I decided to give hgweb a shot and managed to get it to run on the new server, mainly with this tutorial.

I can confirm that hgweb seems to be faster (like Eldad already said) and I agree with Martin's statement about being able to view history in a browser.

However, both these advantages are nice, but I could live without them.
If the shared drive works for you, just keep it.
IMO, Installing hgweb is not as easy as Eldad says in his answer (at least it wasn't that easy for me on a Windows server. On the other hand, I know absolutely nothing about web servers and IIS...maybe it would have been easier with that knowledge).




回答2:


Putting a repository on a network share and pushing/pulling to/from it is supported by Mercurial.

When people advice you to access the repository using a webserver (such as hg serve for short-term serving or the CGI/WSGI script for long-term serving), it's probably because of

  • Potential for bugs in network file system drivers/software. Mercurial uses hardlinks internally to make clones efficient, and there has been problems with remote filesystems reporting the hardlink count incorrectly, see bug 761 and bug 1866.

    These bugs were fixed more than two years ago in version 1.6.3 and 1.7.1, respectively. Many people have used repositories stored on network drives before and after these bugs were fixed.

  • The ability to browse the history in your browser, which can be convenient when you want to point a coworker to something in the repository.




回答3:


Just to add to what @Martin wrote.

I have a duplicate setup. A network share and also a web server over the shared repositories. I find that the web is faster. This is especially good for remote connections (as in your case).

The web server setup is very simple and easy.

I hope this helps.



来源:https://stackoverflow.com/questions/16391362/is-there-a-real-advantage-using-a-web-server-for-mercurial-repositories

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!