How to deploy to Heroku using Mercurial? - mercurial

I've been using Mercurial for quite some time and I'd like to start using Heroku as a deployment platform. However, they seem to support Git only. Does anybody knows how to Heroku using Mercurial?

Once you have installed the Hg-Git mercurial plugin, add an alias to the .hg/hgrc of your repository:
[alias]
push-heroku = push git+ssh://git#heroku.com:<app name>.git
You are now able to push your application to Heroku:
hg push-heroku
Be aware that Heroku does not link your repository name with the remote Heroku app name by default.

You can use the Hg-Git Mercurial Plugin

Use hg-git and add this to the repository's .hg/hgrc file under [paths]:
heroku = https://git.heroku.com/<app-name>.git
Now you can deploy by typing:
hg push heroku
It will prompt for username and password. These were stored in your ~/.netrc file when you ran heroku login (don't try to use your heroku account password, it won't work). Copy and paste from there. See: https://devcenter.heroku.com/articles/git#http-git-authentication for more information about authentication.

Related

mercurial + bitbucket + windows 7, how to setup?

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

Redmine doesn't display mercurial repository

I connect repository in projects settings: set repository type as mercurial and set root directory as "/repositories/hg_test" and when i click Repository tab in project i get "The entry or revision was not found in the repository"
Repository separately works great, i can push and pull.
I try to drop tables "changes" and "changesets" in redmine database and do
ruby script/runner "Repository.fetch_changesets" -e production
I get some records in this tables again. Records from my 'hg_test' repository. I think this mean that redmine SEE that repository but cant DISPLAY it.
Why he cant, how to solve this problem? Maybe i must configure something in redmine.
PS OS - Ubuntu 10.04, webserver - nginx with passenger
If your repositories' directory is mounted via SSHFS, be sure to enable -o allow_other when mounting.
Redmine must have permissions to access to your repository. Add webserver's user (in my case it was www-data) in the group ownership of files and directories of repository.
this solution worked for me:
edit (copy *.yml.example if not created yet) file /opt/redmine/config/configuration.yml, and change this line with your hg executable path:
scm_mercurial_command: /usr/bin/hg
restart the webserver containing redmine (typically redmine itself or apache)
test

External mercurial repository in redmine?

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.

Cloning a Mercurial repository over SSH

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.

Where can I get hgweb.cgi file?

Can anyone tell me where can I get the hgweb.cgi file mentioned here:
https://www.mercurial-scm.org/wiki/HgWebDirStepByStep
I'm using a Mac and I have Mercurial installed and running fine. I just want to serve multiple Mercurial repositories to my local network because this hg serve -a 0.0.0.0 works for only one repository.
You can find it in the Mercurial repo: https://www.mercurial-scm.org/repo/hg-stable/file/tip/hgweb.cgi