Setup of Hg server under Windows

Source: Internet
Author: User
Tags mercurial

1. Environment and required tool installation

1. Installing Python-2.7.9.exe

2. Installing Mercurial-3.2.3.win32-py2.7.exe

3. Installing Mercurial-3.2.3-x86.msi

4. Install tortoisehg-3.3.2-x64 or tortoisehg-3.3.2-x86

5. Install Windows IIS

2. Operation procedure

1. Build a website, create a new folder D:/hgweb

2. Create a new Web site in IIS with the name Hgweb and the physical path pointing to the previous step D:/hgweb

3. In IIS, select the site you just created, select "Handler Mappings" in the features view on the right, as

Syntax for IIS 7.0 or more

Syntax for IIS 6.0

4. Create a new text file under D:\hgweb, rename it to test.cgi (note with the extension), and edit its contents as follows:

print ' status:200 OK '

print ' content-type:text/html '

Print

print '

Save, and then browse test.cgi in IIS:

url:http://localhost/hg/test.cgi

Interface:

If you can see the above interface, the initial configuration is successful, continue.

If you are prompted for an HTTP error 404.2-not Found

The page you requested cannot be provided because of the ISAPI and CGI Restrictions list settings on the WEB server

Open IIS Manager, navigate to the server level, and locate the ISAPI and CGI restrictions in its list of features:

Double-click to open, inside must exist as shown in the line:

If it does not exist, press the "Add" button on the right of the click to fill in:

If it already exists, but is disabled, enable it.

When you are done, retry opening test.cgi, you should see the IT works Word.

5. Create a new text file in the D:\hgweb directory, rename it to hgweb.cgi, and edit its contents in the following sentences:

#!/usr/bin/env python

#

# An example hgweb CGI script, edit as necessary

# See also Http://mercurial.selenic.com/wiki/PublishingRepositories

# Path to repo or Hgweb config to serve (see ' HG help Hgweb ')

Config = "D:/hgweb/hgweb.config"

# Uncomment and adjust if Mercurial is not installed System-wide:

#import SYS; Sys.path.insert (0, "/path/to/python/lib")

# uncomment to send Python tracebacks to the browser if an error occurs:

#import CGITB; Cgitb.enable ()

From mercurial import demandimport; Demandimport.enable ()

From Mercurial.hgweb import Hgweb, wsgicgi

application = Hgweb (config)

Wsgicgi.launch (Application)

Then create a new text file under D:\Mercurial, rename it to Hgweb.config, and try to browse http://localhost:8080/hgweb.cgi without writing anything. Should be able to see the following interface:

6. Modify Hgweb.config

[Paths]

/repositories/= e:/myweb/*

[web]

BaseURL =/hgweb.cgi

Allow_push = *

Push_ssl = False

7. Create a code Warehouse

Create the Test folder under D:/hgweb, and in the folder, create the HG

Visit hgweb.cgi again to see the picture as:

8. Synchronization

Enter HG clone on the computer you want to sync

9. Submit your code

After modifying a file, set the user name to submit user name in Settings

Setup of Hg server under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.