"No such repository hgadmin" while installing mercurial-server.

1.7k views Asked by At

I'm trying to install mercurial-server. After adding my keys to keys/root and refreshing auth, I tried to clone hgadmin-repo but I get the following error:

$ hg clone ssh://hg@<domain>/hgadmin
remote: mercurial-server: no such repository hgadmin
abort: no suitable response from remote hg!

Anyone know what's the problem?

3

There are 3 answers

0
SyntaxT3rr0r On

Are you sure your clone command syntax is correct? I see at least two errors in it:

  1. You must put the repo you're cloning (not just the destination)
  2. Just as for push, you must use two slashes before hgadmin:

Example FAILING (missing the source repo and using only one '/' before 'home')

 $ hg clone ssh://[email protected]/home/John/delme

Example FAILING (missing the source repo)

 $ hg clone . ssh://[email protected]/home/John/delme

Example SUCCEEDING:

 $ hg clone . ssh://[email protected]//home/John/delme
0
Randy Syring On

I had this same problem and for me it was a problem with the installation of the hgadmin repository. When I installed the package, I got errors from python saying the mercurial package wasn't installed. I assume that happened when mercurial-server tried to initialize the hgadmin repository. So when I went to checkout the hgadmin respistory, there was no .hg directory:

root@myshost:/var/lib/mercurial-server/repos# cd hgadmin/
root@myshost:/var/lib/mercurial-server/repos/hgadmin# ls -a
.  ..

In order to resolve this, I did:

easy_install mercurial
sudo apt-get purge mercurial-server
sudo rm -rf /var/lib/mercurial-server
sudo apt-get install mercurial-server

And then continued on with the directions here:

http://kurtgrandis.com/blog/2010/03/20/gitosis-for-mercurial/

0
Ad N On

Thanks a lot Randy for exposing the exact issue here.

I struggled with the same problem, and found an alternative approach to solving it (without the need to purge and re-install).

You can initialize the hgadmin repo manually and install the hooks, achieving the same effect as a normal installation. You need to to it as 'hg' user though.

Procedure

The commands worked for my environment (Ubuntu 10.04.4 / Hg 1.4.3)

First initialise a mercurial repository in /var/lib/mercurial-server/repos/hgadmin :

$ sudo su hg
$ cd ~/repos/hgadmin/
$ hg init

Then the only difference I found with a normally initialized hgadmin repo (that I deployed in a VM for comparison) were the hooks in .hg/hgrc file. So open the file :

$ vim .hg/hgrc

and paste this exact content :

# WARNING: when these hooks run they will entirely destroy and rewrite
# ~/.ssh/authorized_keys

[extensions]
hgext.purge =

[hooks]
changegroup.aaaab_update = hg update -C default > /dev/null
changegroup.aaaac_purge = hg purge --all > /dev/null
changegroup.refreshauth = python:mercurialserver.refreshauth.hook