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?
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/
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
Are you sure your clone command syntax is correct? I see at least two errors in it:
You must put the repo you're cloning (not just the destination)
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
Related
I have a Netbeans property file that had a conflict. I removed the conflict manually and attempted to resolve it using resolve -m, but mercurial does not seem to accept this mark:
$ hg resolve -m RESTServices/nbproject/project.properties
$ hg resolve --list
U RESTServices/nbproject/project.properties
R RESTServices/web/main.js
R RESTServices/web/summer_api/renderable_alpha/PlatonicRenderable.js
$ hg commit -m "resolved"
abort: unresolved merge conflicts (see hg help resolve)
Any ideas?
Thanks , K
How to install Mercurial and TortoiseHG on CentOS 6.5?
This is not trivial, as there is no official RPM for this.
See procedure as a bash script below.
I hope this helps
This procedure is a joining of instructions from several locations.
Create a script with the content below and run it as root.
#!/bin/bash
# Installation of mercurial and TortoiseHG
APPS_BASE=/opt
HG_BIN=$APPS_BASE/bin
HG_REPOS=$APPS_BASE/repos
checkResult()
{
if [ $1 -ne 0 ]
then
echo;echo ERROR: $2 failed;echo
exit 1
else
echo;echo Action $2 OK;echo
fi
}
######### Start here #########
echo;echo Adding epel-release repository
yum -y install http://ftp.uninett.no/linux/epel/6/i386/epel-release-6-8.noarch.rpm
checkResult $? "yum install epel-release"
# Get more prereq packages
echo;echo Install some more packages needed
yum -y install PyQt4-devel python-devel python-iniparse gcc gettext
checkResult $? "yum install PyQt4-devel python-devel python-iniparse gcc gettext"
yum --enablerepo=epel -y install qscintilla-python python-keyring python-sphinx Django
checkResult $? "yum install qscintilla-python python-keyring python-sphinx Django"
# Install Mercurial from source to bootstrap
echo;echo Get and install Mercurial from source
mkdir $HG_BIN $HG_REPOS
cd $HG_REPOS
wget https://www.mercurial-scm.org/release/mercurial-2.4.2.tar.gz
checkResult $? "wget for mercurial"
tar xzvf mercurial-2.4.2.tar.gz
cd mercurial-2.4.2/
make local
checkResult $? "make local for mercurial"
# Get a Mercurial clone, to stay up to date
echo;echo Get and install Mercurial stable
./hg clone https://www.mercurial-scm.org/repo/hg#stable ../hg
checkResult $? "hg clone https://www.mercurial-scm.org/repo/hg#stable"
cd ../hg
make local
checkResult $? "make local for mercurial stable"
echo;echo Create link for hg
cd $HG_BIN
ln -s $HG_REPOS/hg/hg .
# now get a TortoiseHg clone
echo;echo Get the TortoiseHG
cd $HG_REPOS
$HG_BIN/hg clone https://bitbucket.org/tortoisehg/thg thg
checkResult $? "hg clone https://bitbucket.org/tortoisehg/thg"
echo;echo Create links for thg
cd thg
ln -s ../hg/mercurial/
ln -s ../hg/hgext/
cd $HG_BIN
ln -s $HG_REPOS/thg/thg .
echo;echo Install kdiff3
yum -y install kdiff3
checkResult $? "yum install kdiff3"
# Cleanup
echo;echo Cleanup
rm -rf $HG_REPOS/mercurial-2.4.2/ $HG_REPOS/mercurial-2.4.2.tar.gz
echo;echo Add $HG_BIN to path
echo "export PATH=$HG_BIN:$PATH" >> /etc/profile
Once this is done, you will have two links
/opt/bin/hg - mercurial
/opt/bin/thg - tortoiseHg
Of course you can easily move things around as you see fit.
EDIT: If anyone has an idea on how to get the nautilus extensions working, please add here!
EDIT 2: (Contributed by #Will-I-am-davidon). Needed to install some more packages to get the thg working: yum install PyQt qscintilla qscintilla-python
Didnt work for me sorry !!! After having been spent 2 Hours finding the issue for "incorrect data format" I just removed checkSum() and everywhere below wrote ECHO
it worked for me 100%
THANKs =)
In my case i wanna update my production server with a project of my own hosted in BitBucket.org, so you try as i did with Installing on CentOS 6.3
As outlined in Mercurial Download, create /etc/yum.repos.d/mercurial.selenic.com.repo and paste in the following:
[mercurial.selenic.com]
name=mercurial.selenic.com
baseurl=https://www.mercurial-scm.org/release/centos$releasever
enabled=1
# Temporary until we get a serious signing scheme in place,
# check https://www.mercurial-scm.org/wiki/Download again
gpgcheck=0
Then you can issue the command sudo yum install hg.
After reinstall mercurial-server, directory '/var/lib/mercurial-server/' missing
apt-get purge mercurial-server
sudo rm -rf /var/lib/mercurial-server
sudo apt-get update
sudo apt-get install mercurial mercurial-server
i try:
shabak#Ubuntu:/etc/mercurial-server$ cd /var/lib/mercurial-server
-bash: cd: /var/lib/mercurial-server: No such file or directory
I can't find the folder 'repos'.
Please help!
The install script creates and initializes that directory only if the "hg" user doesn't exist. Otherwise it assumes you have an existing setup it should use. Try adding these deluser and delgroup commands to what you're doing:
apt-get purge mercurial-server
deluser --remove-home --system hg
delgroup --system hg
rm -rf /var/lib/mercurial-server
apt-get update
apt-get install mercurial mercurial-server
Alternately, before the "purge", do "dpkg-reconfigure mercurial-server" and set the option that destroys all data.
I'll detect and fix this in a future revision - thanks for reporting it!
Are you aware that mercurial-server isn't part of the mercurial project? It's a poorly maintained, third party application that does very little (nothing?) that mercurial can't already do without it.
If you're just trying to serve mercurial repositories consider using the hgweb program that came with Mercurial, or just use ssh access to the repositories in which case you need no software past the mercurial client at all.
I create a local repo with
local-host $ hg init ~/test/
and then in the remote host i do a clone
remote-host $ hg clone ssh://user#local-host/test
without any issues.
When im trying to check if there are outgoing changes in the remote repo im getting this error
remote-host $ cd test
remote-host $ hg --verbose out
comparing with ssh://user#local-host/test
running ssh user#local-host 'hg -R test serve --stdio'
searching for changes
no changes found
remote: abort: no repository found in '/home/user' (.hg not found)!
remote: abort: no repository found in '/home/user' (.hg not found)!
If i commit any change in the remote/local repository and push it im getting the error but the change gets pushed.
Both hosts have the same mercurial version.
Any ideas ?
You need to let it know which repository - easiest is:
remote-host $ cd ~/test/
remote-host $ hg --verbose out
I tried committing to a local hg repo and it refuses:
trouble committing plot.py!
note: commit message saved in .hg/last-message.txt
abort: Permission denied: /home/md/md_perf/.hg/store/data/plot.py.i
Your file permissions are messed up inside the local repository -- probably someone else pushed or committed to that repository without making sure they were leaving the permissions in a state usable by your whole group. Try these, with the appropriate substitutions, and sudo if necessary:
chgrp -R yourgroup /home/md/md_perf
chmod -R g+rwX /home/md/md_perf
find /home/md/md_perf -type d -print0 | xargs -0 chmod g+s