can not get sources from bitbucket - mercurial

Windows XP, Mercurial 1.6.4
hg clone https://demas#bitbucket.org/demas/start.here
destination directory: start.here
requesting all changes
abort: error:
But if I use SSH all works fine
hg clone ssh://hg#bitbucket.org/demas/start.here
Debug info:
hg clone --debug https://demas#bitbucket.org/demas/start.here
using https://bitbucket.org/demas/start.here
http auth: user demas, password not set
sending between command
destination directory: start.here
sending heads command
requesting all changes
sending changegroup command
abort: error:
Why? And how I fix it?

Use a custom configuration to workaround the handling of self-signed certificates:
Note that per the default settings installed, connect to repositories with self-signed certificates fail with 1.7.3. You need to adjust the default configuration for that case.
References
CA Certificates in hg on Windows
hg import from a https URL fails

Related

Problems integrating Jenkins and Mercurial

I am getting the next error:
java]Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\jobs\test1\workspace
$ hg clone --rev default --noupdate ssh://locahost/*/test1 "C:\Program Files (x86)\Jenkins\jobs\test1\workspace"
remote: Unable to open connection:
remote: Host does not existabort: no suitable response from remote hg!
ERROR: Failed to clone ssh://locahost/*/test1
ERROR: Failed to clone ssh://locahost/*/test1
Finished: FAILURE
In mercurial pluging from the jenkins console I have used
Repository URL: ssh://locahost/*/test1
The rest options are in default
Any idea?
Thanks
I don't know why you have a * character in your path to the remote repository, but that seems likely to be the culprit for this particular error (it generates similar errors against my own hg server).

How to authenticate and clone a remote repository in TortoiseHg

I am trying to clone a repo on a remote Ubuntu server to my local Windows file system. Never done this before. I have TortoiseHg 0.9.3. I right-click and empty folder and in the TortoiseHg flyout I select "Clone". I enter ssh://myusername#mydomain.org/test as the source path (that's where my repo is) and the current location as the destination path. Then I hit "clone".
TortoiseHg says:
running ""C:\Program Files\TortoiseHg\TortoisePlink.exe" -ssh -2
myuser#mydomain.org "hg -R test serve --stdio"" ... no suitable
response from remote hg [command interrupted]
I then get a popup from PuTTY: "Network error: connection timed out".
Where did I go wrong? I was never asked for my password. Where do I enter that?
Fixed the problem by upgrading TortoiseHg from 0.9.3 to 2.6.x

Accessing Mercurial repositories over SSH

I can successfully access repositories over http:// using hgweb.cgi:
$ hg clone http://mydomain.com/scgi-bin/hgweb.cgi/myrepo
I can also successfully ssh into mydomain.com using a password.
$ ssh myname#mydomain.com
myname#mydomain.com's password: xxxxxx
Last login: Sat Jun 9 .....
myname#mydomain.com [~]# ls public_html/scgi-bin
./ ../ hgweb.cgi*, hgweb.config
However I can't deduce how to serve repositories via SSH. For example, this doesn't work:
$ hg clone ssh://myname#mydomain.com/public_html/scgi-bin/hgweb.cgi/myrepo
myname#mydomain.com's password: xxxxx
remote: stdin: is not a tty
remote: bash: hg: command not found
abort: no suitable response from remote hg!
I'm concluding that unlike http://, ssh:// doesn't know how to run the cgi script, would that be correct? Is there a solution to this?
(btw: this is on shared hosting, where http's root is public_html/, ssh's root is one directory up.)
HTTP is not the same as SSH. HTTP is a stateless, request-based transmission protocol. SSH is a protocol which establishes a permanent, stateful connection between two machines.
Your HTTP URL looks like a full path to a repository, but it goes through a web server, which is executing the hgweb.cgi script, passing it myrepo as an argument. The hgweb.cgi script runs Mercurial on the server against the myrepo repository (it pulls the actual location from a config file on the server). The command chain looks like this:
Local Mercurial -> HTTP -> Web Server -> hgweb.cgi > Server Mercurial
The SSH URL you're using in the second example tells Mercurial to log into the mydomain.com server as myname, and it can find the repository at /public_html/scgi-bin/hgweb.cgi/myrepo. Most likely, that isn't where your repo is at. The command chain looks like this:
Local Mercurial -> SSH -> Server file system
You need to change your SSH URL to use the absolute path to the repo on the server:
hg clone ssh://myname#mydomain.com/path/to/myrepo
It also looks like the server can't find the Mercurial executable.
Upon using hg's 'verbose' option, two problems were revealed:
When called over ssh, hg automatically tries to run the hg server, hence no need to go via hgweb.cgi.
The path for the hg command (which was set in .bash_profile) didn't get used for non-interactive SSH commands. I had to put the path to hg somewhere that was, such as .bashrc.
Fixing all that up, the following command worked as expected:
hg clone ssh://myname#mydomain.com/public_html/myrepo

can't push/pull from mercurial repository - abort: error: An existing connection was forcibly closed by the remote host

I am planning to use mercurial for a new project but I'm having some problem accessing the bitbucket repository. I'm new to mercurial, but I have used git previously.
I get the following error when peforing a hg clone or push:
abort: error: An existing connection was forcibly closed by the remote host
I only have this problem when using my work pc, when accessing the repository from my home pc I can clone and push just fine, any ideas, is there some firewall setting that needs to be configured?
I'm using Mercurial-2.1.2-x64 on windows 7 x64 for both pcs.
So I found the source of the error, I had initially installed tortoise hg which had created the following mercurial.ini file in my user directory, once I deleted this file, it resolved the issue. I suppose the problem was that I had specified the repository url instead of an actual http proxy...
# Generated by TortoiseHg settings dialog
[tortoisehg]
cipushafter =
[http_proxy]
host = https://****#bitbucket.org/****/*** (my repository path)
Browse to the project folder in command prompt and run hg rollback.

Can not clone mercurial (hg) repository via http

I can't clone my repository via http:
abort: 'http://MYREPO' does not appear to be an hg repository!
Firstly, I created a new repo by hg init MYREPO followed by adding some file and commit.
The dir with my repo is password protected but there is no sign of problem because of it, I tried both methods of cloning:
(on my local machine)
hg clone http://MYREPO my_repo
and
hg clone http://user:password#MYREPO my_repo
Permissions of repo dir are: drwxrwxr-x
I can clone this very repository on my remote machine (the same repo is on) without any problems.
What could be possibly wrong?
UPDATE:
Looks like you're getting confusing between repository and hostname
If running "hg serve", "hg clone http://USER#HOST:8000" where host can be you machine's IP or the hostname (type "hostname" on linux or try "ping localhost"). You can change the default port from 8000 by passing a --port #### to hg serve.
If you want to do it over ssh, "hg clone ssh://USER#HOST//PATH/TO/YOUR/REPOSITORY". Suppose you made an repository in your home directory called MYREPO then you would do this: "hg clone ssh://USER#HOST/~/MYREPO"
You can only clone your repo via http is something is serving that repo over http. Mercurial provides a built in http server for you. Run "hg serve" while inside of your repo then attempt to clone it from another location (or another command shell). If you just want a local clone, you don't need to use http ("hg clone ").
Also, try "hg help clone" and "hg help serve" for details.
weirdly, cloning with ssh requires a non-intuitive extra forward slash.
this works for me on a host with ssh running on port 43211
hg clone ssh://example.com:43211//repos/myRepo ./myRepo
the double slash after the port number works, but a single slash there results in the ".hg not found" error
besszero is right, but why don't you clone using SSH if you are gonna use username and password anyway?
hg clone ssh://machine_ip//your/repo/location your_repo
It's also safer if you don't want to open another port for mercurial's http server and you don't need the hgweb features, the traffic is also encrypted. The only con is that you have to log in to checkout, but HTTP doesn't work for pushing back the changes, at least not in my experience.
Argh... One need to be careful with .htaccess configuration. In my case I needed to add 'hgwebdir.cgi' to the path to clone... Thanks for the answers though!
SSH seems logical but somehow I couldn't use it with user other than my local:
hg clone ssh://MY_REMOTE_USER#MYREPO
remote: abort: There is no Mercurial repository here (.hg not found)!