Posted by: Josh | May 25, 2010

Introducing Hg-PHP, a web Mercurial repository manager

For those that have successfully deployed Mercurial to shared hosting, Hg-PHP Mercurial Repository Manager adds a web interface to manage the hosted repositories. For this first release (v1.0.20100516), features include:

  • create new and delete existing repositories (modifies to hgweb.config)
  • update individual repository settings, controlled available config options (modifies hgrc)
  • integrated changeset, graph and file browser via original Mercurial web front-end
  • overwrite protection (optimistic locking prevents accidental change cancellation when another user makes a change)
  • theme mimicry (manager skinnable with the same stylesheet as available Mercurial web styles)
  • basic authentication – filter repository-authenticated users by username

Installation is simple when performed in addition to my previous Mercurial shared server installation guide.

  1. Install Mercurial through this simple setup guide and ensure it is functional.
  2. Download the latest release of Hg-PHP.
  3. Extract and upload to the web server. If correct, the ‘admin’, ‘python’ and ‘cgi-bin’ folders should be in the same directory.
  4. Configure the application to finish the installation, modifying the files in /admin/application/config/:
    1. .htaccess: It might be appearing as hidden in the / directory, it needs your htpasswd file location. You’ll see an “Internal Server Error” if this isn’t configured right.
    2. config.php: base_url with the path to /admin on the web server
    3. hgphp.php: repositories_abs_dir with the absolute file path to your Hg repositories folder, hgrc_default_arr/paths/default with the URL of the Mercurial server. You may also add to hgrc_default_arr or set an alternate theme_layout. Relative directories are relative to /admin/index.php.
    4. mantis_auth.php: currently does not use Mantis Bug Tracker session authentication, but you’ll need to modify administrators to include the HTTP basic authenticated users that are permitted full access to the repository manager.
  5. Ensure /admin/lock and /cgi-bin are writable by the web server.
  6. Visit your repository manager by viewing the /admin path.

*Note: an error when accessing /admin like “Mercurial repository not found. The specified repository “500.shtml” is unknown, sorry” is most likely caused when /admin/index.php has write & execute privileges for someone other than the file owner. Change these permissions to fix this error.

Your feedback here and issues filed at BitBucket are much appreciated!

**Edit: This project is being renamed to phpHgAdmin… bigger update coming soon.


  1. […] of Mercurial, serving repositories with it’s web interface (basic installation and setup instructions […]

  2. Thanks for the useful information :)

  3. […] Mercurial; apparently a lot of folks are heading the Hg way. Think I might try it out myself; this Mercurial/PHP web interface looks pretty interesting. I've been wanting to get a nice repository solution setup for my […]

  4. Can I create a FreeBSD port for this ? Would you be willing to provide tarballs etc.. for such?

  5. Chao. Me encanta como has planteado el contenido. ¿Me
    serias tan amable de otorgar bastante mas documentacion de el contenido?
    Estoy muuy con interes en este tema. Enhorabuena Y Gracias.

  6. Me agrada tu Webblog. Me da laa impresion que has desarrollado la
    datos de tal manera bastante atractiva. Te dejo directamente en marcadores!!!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s



Get every new post delivered to your Inbox.

%d bloggers like this: