5

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?

NobbZ
  • 1,360
  • 3
  • 15
  • 30
  • Where on the server is the `hgadmin` repository stored? – dave4420 Apr 01 '10 at 17:22
  • 2
    Just a quick note, are you sure you're looking for "mercurial-server"? I'ts not _the_ mercurial-server (there isn't one) and it just adds some remote administration features to the existing ssh options, which are more easily done on the server if you have shell access. The PublishingRepositories page on the mercurial wiki gives a lot of easier options than mercurial-server which probably do what you want. Nothing wrong with mercurial-server, of course, I just see a lot of folks start down that path thinking "it's the server for mercurial" when it isn't. – Ry4an Brase Apr 01 '10 at 17:42
  • What OS/distribution/version are you installing, and how did you try to install it? Was mercurial installed before you started? – Paul Crowley May 04 '11 at 13:01
  • What OS/distribution/version are you installing, and how did you try to install it? Was mercurial installed before you started? – Paul Crowley May 04 '11 at 13:01

3 Answers3

7

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/

Randy Syring
  • 1,971
  • 1
  • 15
  • 19
2

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
Ad N
  • 7,930
  • 6
  • 36
  • 80
0

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://John@127.0.0.1/home/John/delme

Example FAILING (missing the source repo)

 $ hg clone . ssh://John@127.0.0.1/home/John/delme

Example SUCCEEDING:

 $ hg clone . ssh://John@127.0.0.1//home/John/delme
SyntaxT3rr0r
  • 27,745
  • 21
  • 87
  • 120