在Windows机器中设置Mercurial服务器 - 教程已过时

Che*_*eng 10 mercurial

我正在引用HgWebDirStepByStep,并试图在Windows机器(Windows 7)中设置它.

  1. 我无法再从http://www.mercurial-scm.org/repo/hg-stable/raw-file/tip/hgwebdir.cgi下载hgwebdir.cgi .链接已经死了.
  2. 我被告知要修改hgwebdir.cgi内容sys.path.insert(0, "c:/dev/Mercurial/lib"),但我没有在我最新的Mercurial安装中找到任何文件夹.我只能看到它上面有一个zip文件.

似乎教程的信息已经过时了.我有什么好的指南在Windows机器上设置Mercurial服务器?由于服务器中已有Apache,我想使用Apache而不是IIS.

Che*_*eng 10

通过从每个角落收集信息位和字节,我想总结使用Apache设置mercurial服务器的步骤,以及身份验证功能.


我安装了mercurial-1.9.1.win-amd64-py2.6.exe


将以下内容添加到C:\ Program Files(x86)\ Apache Software Foundation\Apache2.2\conf\httpd.conf

# Some comment so that you can find these settings later
ScriptAliasMatch ^/hg(.*) "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/hg/hgwebdir.cgi$1"
<Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/hg">
  Options ExecCGI FollowSymLinks
  AuthType Basic
  AuthName "AuthName for Mercurial"
  AuthUserFile "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/hg/passwd.txt"
  <Limit GET POST>
      require valid-user
  </Limit>
</Directory>
Run Code Online (Sandbox Code Playgroud)

创建以下4个文件

C:\ Program Files(x86)\ Apache Software Foundation\Apache2.2\htdocs\hg\hgwebdir.cgi(从http://makinggames.ca/wp-content/uploads/2010/05/hgwebdir.txt下载并重命名它到hgwebdir.cgi)

C:\ Program Files文件(x86)的\ Apache软件基金会\ APACHE2.2\htdocs中\汞柱\ hgweb.config具有以下内容.

[paths]
dummy1 = d:/mercurial-repo/dummy1
dummy2 = d:/mercurial-repo/dummy2
Run Code Online (Sandbox Code Playgroud)

c:\ Program Files(x86)\ Apache Software Foundation\Apache2.2\htdocs\hg\passwd.txt(请参阅本指南http://sniptools.com/vault/windows-apache-and-htaccess-authentication)

c:\ Program Files(x86)\ Apache Software Foundation\Apache2.2\htdocs\hg.htaccess(只需将文件保留为空)


初始化存储库

D:\mercurial-repo\dummy0
D:\mercurial-repo\dummy1
Run Code Online (Sandbox Code Playgroud)

这可以使用TortoiseHg,通过右键单击文件夹D:\ mercurial-repo\dummy0D:\ mercurial-repo\dummy1,在此处应用"Create Repository Here"来完成


通过访问mercurial http://your-server:81/hg/


Ant*_*lev 6

您可以尝试HgLab - 一个源控制管理系统和Mercurial Server for Windows,具有推送,拉动和流媒体功能,存储库浏览器,Active Directory集成,ACL和许多其他功能.