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
Related
I have the all-in-one download with TortoiseHg 2.6.1 and Mercurial 2.4.1 installed on windows server 2k8. I created a repository, served it on port 8000. There are no mercurial configuration files setup right now for this repository. No global config files either. When I try to clone this repos through eclipse (MercruialEclipse plugin) from a remote computer over the internet, I get:
abort: HTTP Error 404: Not Found
What does this mean?
Thanks.
Found the solution. The command syntax was incorrect. The incorrect syntax I was using was
hg clone http://www.xyz.com:8000/<dirname for the repo clone>
The correct command is:
hg clone http://www.xyz.com:8000/ <dirname for the repo clone>
Should also mention that I am using version 2.3.2(mercurial)
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
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.
In Git, there is the command
git remote show <remote>
When properly configured, this will show you the status of the remote compared to your local repository, including whether there are pending changes in either. I can't find a similar command in Mercurial. Am I missing something or does it just not exist?
Perhaps hg summary --remote?
To compare local and remote repositories follow these steps:
go to local repo folder (use cd path_to_local_repo)
run "hg outgoing -p path_to_remote_repo" (without quotes)
See GenerateDiffBetweenRepositories
I'm having some difficulty cloning my mercurial repository over ssh.
Here's what I have tried:
hg clone ssh://username#username.webfactional.com/path/to/projectname projectname
It's giving me this error:
remote: bash: hg: command not found
abort: no suitable response from remote hg!
hg is installed on the server, however.
I was trying to follow the instructions on this website.
You need a double // after hostname i.e.:
hg clone ssh://username#username.webfactional.com//path/to/projectname projectname
Sounds like hg is not on your path. The Mercurial FAQ mentions possible fixes for this issue: FAQ/CommonProblems.
Add the remotecmd value to your Mercurial configuration by opening ~/.hgrc (or Mercurial.ini on Windows) on your client machine and adding the following:
[ui]
remotecmd = /path/to/hg
where /path/to/hg is the path to the hg command on the remote server.
If you're having problems with your Mercurial configuration, you can use the hg showconfig --debug command to obtain a full list of your Mercurial settings along with the path and line number of the configuration file that defines each configuration value.
Looks like mercurial isn't in your user's PATH on the remote server.
On webfactional I had to add:
export PATH=$PATH:/home/<user>/bin
to .bashrc to get it to work.
(also followed the remotecmd advice above)
You can use Sourcetree, TortoiseHg, Mercurial from the terminal, or any client you like to clone your Mercurial repository. These instructions show you how to clone your repository using Mercurial from the terminal.
From the repository, click + in the global sidebar and select Clone
this repository under Get to work.
Copy the clone command (either the SSH format or the HTTPS).
If you are using the SSH protocol, ensure your public key is in Bitbucket and loaded on the local system to which you are cloning.
From a terminal window, change to the local directory where you want to clone your repository.
Paste the command you copied from Bitbucket, for example:
CLONE OVER HTTPS:
$ hg clone https://username#bitbucket.org/teamsinspace/hg-documentation-tests
CLONE OVER SSH:
$ hg clone ssh://hg#bitbucket.org/teamsinspace/hg-documentation-tests
If the clone was successful, a new sub-directory appears on your local drive.
This directory has the same name as the Bitbucket repository that you cloned.
The clone contains the files and metadata that Mercurial requires to maintain the changes you make to the source files.
On the server, type: nano ~/.bashrc end edit the file by adding:
# User specific aliases and functions
export PATH=$PATH:$HOME/packages/mercurial
Under the assumption that ~/packages is the folder where mercurial was installed.
After editing, finish off with source ~/.bashrc and try again.
Pretty helpful to me was the following elaborate guide to install mercurial on a Bluehost hosting server.