Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 923
Vladimir Parfinenko Avatar asked Apr 01 '10 17:04

Vladimir Parfinenko


2 Answers

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/

like image 140
Randy Syring Avatar answered Oct 12 '22 10:10

Randy Syring


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
like image 32
Ad N Avatar answered Oct 12 '22 12:10

Ad N