Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1037751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:53:20+00:00 2026-05-16T14:53:20+00:00

Note, this might perhaps be best suited on serverfault.com, but since it is about

  • 0

Note, this might perhaps be best suited on serverfault.com, but since it is about hosting a programmer source code repository, I am not entirely sure. I’m posting here first, trusting that it’ll be migrated if necessary.

I’m attempting to host clones of my Mercurial repositories on my own server (I have the main repo somewhere else), and I’m attempting to set up Mercurial under IIS.

I followed the guide here, but I get an error message.

Solved: See bottom of this question for details.

The error message is:

mercurial.error.RepoError: repository /path/to/repo/or/config not found

Here’s what I did.

  1. I installed Mercurial 1.5.2
  2. I created c:\inetpub\hg
  3. I downloaded the hg source as per the instructions of the webpage, and copied the hgweb.cgi file into c:\inetpub\hg (note, the webpage says hgwebdir.cgi, but this particular file does not exist, hgweb.cgi does, however, can this be the source of the problem?)
  4. I added a hgweb.config, with the following contents:

    [paths]
    repo1 = C:/hg/**
    [web]
    style = monoblue
    
  5. I created c:\hg, created a sub-directory test, and created a repository inside it

  6. I installed python 2.6.5, latest 2.6 version from the website (the webpage mentions I need to install the correct version or I’ll get a specific error message, since I don’t get an error message that looks remotely like the one mentioned, I assume that 2.6.5 is not the problem)
  7. I added a new virtual host hg.vkarlsen.no, pointing it to c:\inetpub\hg
  8. For this host, I added a script mapping under the Handler Mappings section, mapping *.cgi to c:\python26\python.exe -u %s %s as per the instructions on the website.

I then tested it by navigating to http://hg.vkarlsen.no/hgweb.cgi, but I get an error message.

To make it easier to test, I dropped to a command prompt, navigated to c:\inetpub\hg, and executed the following command (error message is part of the text below):

C:\inetpub\hg>c:\python26\python.exe -u hgweb.cgi
Traceback (most recent call last):
  File "hgweb.cgi", line 16, in <module>
    application = hgweb(config)
  File "mercurial\hgweb\__init__.pyc", line 12, in hgweb

  File "mercurial\hgweb\hgweb_mod.pyc", line 30, in __init__

  File "mercurial\hg.pyc", line 82, in repository

  File "mercurial\localrepo.pyc", line 2221, in instance

  File "mercurial\localrepo.pyc", line 62, in __init__

mercurial.error.RepoError: repository /path/to/repo/or/config not found

Does anyone know what I need to look at in order to fix this?


Edit: Ok, I think I managed to get one step closer to the solution, but I’m still stumped.

I realized the .cgi file is a python script file, and not something compile, so I opened it for editing, and these lines was sitting in it:

# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "/path/to/repo/or/config"

So this was my source for the specific error message.

If I change the line to this:

config = "c:\\hg\\test"

Then I can navigate the empty repository through the Mercurial web interface.

However, I want to host multiple repositories, and seeing as the line says that I can also link to a hgweb config file, I tried this:

config = "c:\\inetpub\\hg\\hgweb.config"

But then I get the following error message:

mercurial.error.Abort: c:\inetpub\hg\hgweb.config: not a Mercurial bundle file
Exception ImportError: 'No module named shutil' in <bound method bundlerepository.__del__
of <mercurial.bundlerepo.bundlerepository object at 0x0260A110>> ignored

Nothing I’ve tried for the config variable seems to work:

config = "hgweb.config"
config = "c:\\hg\\hgweb.config"
  • various other variations I don’t remember.

So, still stumped, pointers anyone?

Hopefully this question will give others some information if they’re stumped as I was.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:53:20+00:00Added an answer on May 16, 2026 at 2:53 pm

    I ended up having to edit the hgweb.cgi file:

    from:  from mercurial.hgweb import hgweb, wsgicgi
           application = hgweb(config)
    
    to:    from mercurial.hgweb import hgweb, hgwebdir, wsgicgi
           application = hgwebdir(config)
    

    Note the added hgwebdir parts there. Here’s my hgweb.config file, located in the same directory as hgweb.cgi file:

    [collections]
    C:/hg/ = C:/hg/
    
    [web]
    style = gitweb
    

    This now serves my repositories successfully.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.