HG-SERVICE

HgService is a windows service wrapper for hg mercurial. After installing HgService you can run hg mercurial repository as a windows service instead of running "hg serve" in a command prompt.

http://bitbucket.org/andrearicossa/hgservice/

Install instructions:

  1. install hg mercurial on the server
  2. create a repository using hg init
  3. download the hgservice project from bitbutcket (http://bitbucket.org/andrearicossa/hgservice/). Run msi or exe that you will find in the project bin folder.

  4. modify the .config file presents in the install folder (all the setting keys could be empty):
    • CommandLine the program to run (by default is hg.exe)

    • CommandLineArguments the hg commands or options. eg. "serve --web-conf .\web.config -A c:\logs\access.log -E c:\logs\error.log"

    • WorkingDirectory the repository folder, if it's not specified it takes the install directory


This example configuration will start mercurial web server on port 8000, and server out the repository at "c:\path\to\repository", allowing pull and push. 1 2
HgService.exe.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
    <add key="CommandLine" value="C:\Program Files\TortoiseHg\hg.exe"/>
    <add key="CommandLineArguments" value="serve --web-conf .\web.config -A c:\logs\access.log -E c:\logs\error.log" />
    <add key="WorkingDirectory"     value="" />
  </appSettings>
</configuration>

web.config

[web]
allow_push = *
push_ssl = false

[paths]
yourrepositry = "c:\path\to\repository"

Author: Andrea Ricossa - andrea.ricossa[at]gmail.com


CategoryWindows CategoryWeb

  1. Don't put this configuration on a internet facing server. (1)

  2. The local service account will need write access to "c:\logs" and "c:\path\to\repository". (2)

HgService (last edited 2012-02-09 01:26:16 by smtp)