thanks to the help of Stackoverflow I was able to setup an account and repository on bitbucket and manually push my local repo to the cloud using password.
I was unable to find a proper tutorial on how to setup SSH between mercurial and bitbucket using Windows 7 and also I was unable to find a proper tutorial on how to automatize the push command to avoid writing the full path all the time of each of the repositories.
Anyone can help on achieveing those two issues?
to find a proper tutorial on how to setup SSH between mercurial and bitbucket
Keywords: plink, pageant
proper tutorial on how to automatize the push command to avoid writing the full path all the time of each of the repositories
"Full path" to local or remote repo?
In case
Local, and using -R "path/to/local/repo" - just cd to repo always before using HG
Remote - add all needed repositories into .hgrc of repository (.hg\hgrc from the root of repo-dir) [paths]
[paths]
default = git+ssh://git#github.com/lazybadger/Fiver-l10n.git
sf = ssh://bigbadger#hg.code.sf.net/u/bigbadger/code
With these names I can pull/push from/to default || sf as URLs: hg push sf, "default" as default target can be omitted totally
Related
Using "raw" mercurial API I can write just something like:
peer = hg.peer(ui.ui(), {}, 'ssh://hg#bitbucket.org/some/project')
After the connection is established, I can work with remote repo.
I'm failing to understand what should work with a remote repo using hglib.
Naïve approach, i.e. using something just as simple as:
hglib.open("ssh://hg#bitbucket.org/some/project")
does not work, and the exception raised does not make anything clearer to me.
My question: With hglib, how can I open connection to a remote ssh-repo?
The hglib documentation is not very wordy about how to use it. The best is to already have your key copied and RSA fingerprint in your ~/.ssh/known_hosts.
But you can clone a repo with:
hglib.clone(source="ssh://hg#bitbucket.org/some/project")
You can of course add destination folder (e.g. dest="/path/to/blah").
If you already have an existing hg repo cloned you can change some settings in your hgrc before trying hglib.open(), so hg uses the ssh url like so:
[ui]
username = some_user
[paths]
default = ssh://hg#bitbucket.org/some/project
EDIT
I think for hg.open to work, you have to have a repo checked out. For me I refer to the path where my repo is cloned. So:
hglib.open('/path/to/cloned/repo')
To do this over SSH you have to edit your /repopath/.hg/hgrc as mentioned above.
My hg repository is on a server that I can reach with ssh and sftp.
So I can mount the remote dir on my desktop (debian) and can edit the file there.
Now I would like to use Tortoisehg, but I would rather not to clone the repo locally, but just using the remote one that is now mounted locally.
How can I do th?
Now I would like to use Tortoisehg, but I would rather not to clone the repo locally, but just using the remote
It's, in common, The Bad Idea (tm) to use repository from network drive, but:
use this repo the same way, as you edited files in working dir of repository
* Mount to any point of local FS
* Add repository to TortoiseHG Workbench, using "translated" local path to repository
* Use repository as any other really local
But clone|push way is more natural and bullet-proof (no chances to get corrupted repo, real backup of your local repository on remote host)
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
Is this possible to have external mercurial repository in redmine just like svn?
For svn i've got following configoration options and it work with external repos:
For mercurial i can only enter local path to repository:
I don't think this is possible, you will need a local clone as stated in the Redmine documentation:
Mercurial repository
To synchronize with a Mercurial
repository, you will have to have a
local clone of the repository on the
same server you have Redmine installed
on. Let's say you put Redmine in
/var/www/redmine.example.com/www and
have put your mercurial repository in
/var/www/sources.example.com/repo/example,
you would have to select Mercurial as
a SCM, then enter
/var/www/sources.example.com/repo/example
in the repository text box.
A similar question has been asked in the Redmine forums. You'll need to set up a local clone and update it automatically, e.g. by using a cron job.
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.