External mercurial repository in redmine? - mercurial

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.

Related

Updating a local mercurial copy with a specific commit from another remote site

(I'm using real examples, so it is clearer.)
I cloned an official Mercurial repository locally
hg clone https://bitbucket.org/Coin3D/soqt -r default
from this repo: https://bitbucket.org/Coin3D/soqt/branch/default
Now I want to update my local copy with a commit taken from a remote fork of the main project:
https://bitbucket.org/roboticslibrary/soqt/branch/patch-hidpi
How can I integrate a specific commit from a remote fork (#214c74a in this example) into my local clone?
With git I would add the remote fork, then I would use "fetch" on that and then I would use "cherry-pick" to get the specific commit.
Is that possible at all in Mercurial?
Thanks a lot!

Pull a web repository into local using Mercurial command

I'd like to pull a Mercurial web repository into my local filesystem to work. I used the following command but I get the error: Merucrial Repository (.hg directory not found). But my boss said Mercurial is installed in the machine.
hg pull https://username#web_repository_name
What is the proper way to get a working copy of a Mercurial repository?
You need to start by executing a clone of the repository, after which you can use pull to incrementally add new changes.
These are really the basics of Mercurial, so I would propose you read this tutorial, followed by this Mercurial guide.

Re-synching Mercurial repositories after a machine re-installtion

I just had to re-install the system drive on my PC.
As a result I've a load of Mercurial repositories on another drive that have lost their association with the repository server.
All the local repositories are up to date as I'm the only one working on them and everything was synched before the PC's re-installation.
I'm using Tortoise hg and BitBucket.
I don't want to have to delete the repositories and re-clone them to get it all working again as this strikes me as a long way round an needless use of bandwith.
Is there a simple way to tell a local repository to re-connect to the repo on the server?
Thanks, Matt
Yeah, you just edit the default entry in the [paths] section of the repos .hg/hgrc file. You can see what it's currently set to with the hg paths command. Correct it and you're good to go.

Mercurial repository corruption repair says it's not a mercurial repository?

So I have managed to corrupt my mercurial repo. So I am following the steps from the repository corruption page on the wiki to repair it.
When I run the convert command:
hg convert --config convert.hg.ignoreerrors=True REPO REPOFIX
It gives me the following output:
initializing destination REPOFIX repository
REPO does not look like a CVS checkout
REPO does not look like a Git repository
REPO does not look like a Subversion repository
REPO is not a local Mercurial repository
REPO does not look like a darcs repository
REPO does not look like a monotone repository
REPO does not look like a GNU Arch repository
REPO does not look like a Bazaar repository
cannot find required "p4" tool
Why on earth would it say that? And how can I go about fixing it?
It definitely is a mercurial repository, it's hosted on Bitbucket, and I am using Tortoisehg to manage it.
Edit:
I think maybe I can't do this against a remote repository? How can I go about fixing this then?
You probably did not corrupt the remote repository at Bitbucket, did you?
It's more likely you corrupted your local copy, and so you can just clone it from Bitbucket again or try the hg convert … trick on your local copy (i.e. the folder you manage with TortoiseHG).
A bit late but I faced the same issue. The mistake was running that command inside the project folder. You have to run the command outside the folder containing the .hg file. I could not find a way through TortoiseHg console to move up a directory so I used windows terminal.

Using one Mercurial repository as local for two Mercurial installations

We have a dedicated issue tracking (Redmine) machine, which has a Mercurial repository (call it "Redmine repository"). Redmine is set up to use that repository, and as far as I understand, Redmine never makes any changes to that repository. All developers (eventually) push their changes to that repository.
We also have a dedicated production machine, which can execute the code, but is not used to make any changes to the code.
We have two choices:
Set up another Mercurial repository on the production machine (call it "production repository"). When a new production release is approved, pull the changes from the Redmine repository to the production repository, and then update the local working directory to the appropriate revision from the production repository.
Reuse the existing Redmine repository on the production machine designating it a local repository for the Mercurial installation there (the Redmine repository is on the shared drive that can be easily mounted on the production machine). Whenever a new production is approved, update the local working directory to the appropriate revision from the Redmine repository.
With option #2, we get rid of an extra "pull" step (from Redmine repository to production repository), which slightly simplifies the process. But I'm not sure if it's ok that a single repository is used by two Mercurial installations as if it's local.
Any comments on this choice (or any other aspect of this setup) is appreciated!
It sounds like a bad idea. Mercurial does a really good job of keeping reads and writes to its repository atomic, but it has a harder time doing that when the repository is on a shared drive -- even if it's only one local repository using it -- because network shares (especially on Windows) don't always make things atomic that they say they do.
Ideally your repositories (both the working dir and the repository) are local when possible, and you use push/pull to get changesets to/from a network share. If that's not possible then having a single local application using the repo on the remote file system is the best idea.
If you positively want to try having two clones using the same underlying repository check out the ShareExtension, which ships with Mercurial but is for advanced users only.
Instead of trying to piggy-back, why not just put a hook like this in your redmine repository:
[hooks]
changegroup = hg push //production/clone
That will automatically push changesets that arrive in redmine to production.