I need to download the source code from the Mercurial.
$ hg clone xmppframework.googlecode.com/hg xmppframework
warning: xmppframework.googlecode.com certificate with fingerprint b1:af:83:76:f3:81:b0:57:70:d8:07:42:c8:c1:b3:67:38:c8:7a:bc not verified (check hostfingerprints or web.cacerts config setting)
requesting all changes
adding changesets
adding manifests
adding file changes
I tried it in terminal by using this link to download the source code.But the command is failed.
Anyone can help me to get rid of this.
Thanks to all,
Madan.
The problem is, that you didn't added the fingerprint of google to your hgrc file.
There are two ways to solve the problem:
Use http instead of https, the disadvantage would be, that your traffic isn't encrypted anymore.
hg clone http://xmppframework.googlecode.com/hg/ xmppframework
Or add the fingerprint to you hgrc file:
Please note that Google Code is changing the fingerprint sometimes. When the fingerprint below doesn't work, you can use this command (taken from this question) to detect the current fingerprint:
$ openssl s_client -connect xmppframework.googlecode.com:443 < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -in /dev/stdin
[hostfingerprints]
xmppframework.googlecode.com = b1:af:83:76:f3:81:b0:57:70:d8:07:42:c8:c1:b3:67:38:c8:7a:bc
Edited because original answer was ugly.
It's not a SVN link, it's Mercurial link, so you can't use svn tool. You need Mercurial for this.
Related
I need a mercurail template/keyword "hostname" to get the name (or IP) of the computer where the repo is located. as far as i read the wiki, namely "Chapter 11. Customizing the output of Mercurial", hg help templates, and the web, I think it should be similar to the date keyword, dynamicly expanded. How can i define my own template/keyword?
Thank you verry much
The following extension should do the trick:
from mercurial import templatekw
testedwith = "3.5"
_ipname = None
def showipname(repo, ctx, templ, **args):
""":ipname: String. The hostname of the machine that the repository
resides on."""
import socket
global _ipname
if not _ipname:
_ipname = socket.gethostname()
return _ipname
def uisetup(ui):
templatekw.keywords["ipname"] = showipname
Then use (say):
hg log -r . -T '{node|short} at {ipname}\n'
Note that the value of socket.gethostname() may depend on your internet connectivity. If you need the value in /etc/hostname or something else that identifies your machine, use that method instead.
To use an extension, put it in a file, say ipnametempl.py somewhere, then add the following lines to your .hgrc:
[extensions]
ipnametempl=/path/to/ipnametempl.py
This can be either your user/global hgrc or the .hg/hgrc in your repository (the latter if you only want to enable it for a specific repository). See hg help hgrc to find out where the user/global hgrc files are on your system.
Either the repository is local to your machine (then you can get the absolute path via hg root) and query the name via the normal system tools. You can embed those also in your templates:
$ hg log -r. --template="{branch}-{rev} from $(hostname) running debian $(cat /etc/debian_version)"
trunk-22248 from MYHOSTNAME running debian 8.2
Or you know already the URL (remote path) in order to operate with it as you need to specify it as argument to hg pull/clone/outgoing/incoming
If the remote URL is not explicitly specified on the command line it is specified in your .hgrc in the [path] section. When there is a remote repository at all, then usually a default = URL is defined there.
If you need the URL printed, then install hooks for clone, pull and push (and maybe outgoing and incoming) which prints the $URL as available in those hooks - or maybe just the changegroup hook. Check http://hgbook.red-bean.com/read/handling-repository-events-with-hooks.html#sec:hook:changegroup and hg help config.
all,
I have searched for this problem for long time and tried different methods.
I want to maintain my code on the server through only SSH. But when I run this:
sudo hg clone -v ssh://carl#hostname//home/carl/Java/Projects/peta/
Mercurial keeps telling me remote: abort: There is no Mercurial repository here (.hg not found)!. Some articles said that the path should be correct and there should be a .hg directory there. But I have checked it for several times and I am sure there is a .hg folder at the right place.
I also tried
hg --config ui.remotecmd=/usr/bin/hg clone ssh://carl#hostname//home/carl/Java/Projects/peta/
But it failed as well. What other problem it could be? Thanks.
Solved
I finally fix the problem. Previously, I create a repository on my local machine, and scp all files (including .hg) on to the server. I try to remove .hg directory first, and create a repo on the server through ssh (hg init). Then hg clone works!
Extraction from hg help urls
Some notes about using SSH with Mercurial:
SSH requires an accessible shell account on the destination machine and
a copy of hg in the remote path or specified with as remotecmd.
path is relative to the remote user's home directory by default. Use an
extra slash at the start of a path to specify an absolute path:
ssh://example.com//tmp/repository
this means, at least, that you can't use the same URI and change only one/two slash it it: at least one path will be non-existent.
Consequence of the quote and error message: you must to debug (with any ssh-tool) and find correct path to needed directory. you can:
use scp (f.e) and copy known file from known location
SSH into remote host in interactive session and verify path (both?) by hand, i.e: ssh ..., cd ..., pwd, verify output of pwd
... any other debugger
When you'll get good path after login, you have to check next point of failure - .hg dir permissions
After verification of these checkpoints you'll get clone and some bonus in the form of understanding "What happened before"
HTH
I don't know if this really helps but, according to the FAQ:
hg clone ssh://USER#REMOTE/path/to/repo
They are using only one / after the USER#HOST. Maybe you can try that way.
César Bustíos's answer is almost correct, but that tries to clone from remote to local. To opposite way, we have to add the local path. In the case it is the current directory, it will be a dot.
hg clone . ssh://USER#REMOTE/path/to/repo
Hope it helps. :)
Running on Debian, to solve my problem, I have added the following line to my /var/lib/mercurial-server/.mercurial-server configuration file after the [paths]
[paths]
/ = ~/repos
...
And don't forget to issue this command afterwards: sudo -u hg /usr/share/mercurial-server/refresh-auth
I have been browsing SO and Google for a solution to my basic problem, and so far I have had no luck.
I am brand new to Mercurial and have just installed it on my Mac. I am using it for personal version control and will not be communicating with a central server (yet).
When I try to commit files, I get abort: no username supplied (see "hg help config"). The common solution to this problem is putting the following in ~/.hgrc
[ui]
username = Firstname Lastname <firstname.lastname#example.net>
which I have done, but the error remains. It just won't read the file. Any suggestions?
For future reference: use
$ hg showconfig ui --debug
to see the settings from the [ui] section and to see the files Mercural reads for configuration settings. That should help you along if you ever have to debug such a case again.
I am having a problem to trigger a repository clone of googlecode project.
I keep receiving the following error:
Started by user anonymous $ hg clone
--rev default "https://username#demo.projectname.googlecode.com/hg/ " "F:\Hudson\jobs\project Demostration project\workspace" abort: demo.projectname.googlecode.com certificate error: certificate is for
*.googlecode.com, googlecode.com, *.codespot.com, *.googlesource.com, googlesource.com (use --insecure to connect insecurely) ERROR: Failed to clone.
--template {node}
Anyone know on how to tell jenkins it is safe to use that certificate? In what textbox do you place --insecure option
That's a relatively new command line option (1.8.3 I think) to get around a relatively new practice of actually checking certificates (1.8.2 I think). It's likely not exposed in the Jenkins UI. Some things you could do to work around it:
put the server's cert's fingerprint in a whitelist in your (Jenkin's user's) hgrc
wrap Mercurial in a quick shell script that passes --insecure
clone from the non-https version of the google URL (I think they still allow that)
configure the CACerts for Mercurial either globally (/etc/mercurial/hgrc) or in the Jenkins user's ~/.hgrc
Any of those should work and most of them are explained here: https://www.mercurial-scm.org/wiki/CACertificates
I have a problem specifying per-repository proxy for Mercurial.
If I specify proxy on command-line, everything works:
hg pull --config http_proxy.host=proxyhost:3128
If I specify proxy in ~/.hgrc, everything works too. Contents of ~/.hgrc:
[http_proxy]
host=proxyhost:3128
But if I put that section into .hg/hgrc of local repository, proxy does not work:
user#NOTE:~/Project$ cat .hg/hgrc
[http_proxy]
host=proxyhost:3128
[paths]
default=http://repohost/Project/
user#NOTE:~/Project$ hg pull --debug
using http://repohost/Project/
sending between command
abort: error: Name or service not known
What's wrong?
Sounds like a bug to me. I can see how it would happen too, though it confuses me a bit that the command line --config option works and the repository-level config doesn't. But not too much.