3

3

How do we set up Mercurial source control integration?

flag

2 Answers

2

Getting Mercurial to transmit changes to FogBugz

To setup Mercurial-FogBugz integration, start by logging into FogBugz as an administrator and going to Admin | Source Control. Click Create New Repository. In the resulting dialog, select Mercurial as the type and click Next.

In the resulting dialog, download the Python script and place it anywhere that's visible to the Mercurial server process. It should not be in your hgext directory.

To enable the script, edit the .hg/hgrc file in your repository by adding the following lines:

[hooks]
changegroup = python:/path/to/fogbugz.py:hook

You will then need to configure the FogBugz extension so that it knows where to locate your FogBugz install. Simply add the following lines, edited appropriately, into your .hg/hgrc file:

[fogbugz]
host=http://full/path/to/fogbugz

Finally, you should set your baseurl to make sure that the appropriate repository location is passed along to FogBugz. Baseurl is the web URL to where the "hg serve" web server is running for the provided repository.

[web]
baseurl=http://url/of/your/repo

Getting FogBugz to Provide Hyperlinks to Mercurial

Assuming you supplied the right value for baseurl in your hgrc file, FogBugz will automatically link to logs and diffs in Mercurial. If you do not have hg serve running, then although FogBugz will record changesets, the links back from FogBugz will not point anywhere meaningful.

link|flag
This means a separate Repository listing in FogBugz for each repo as well as modifying the hgrc file for each repo, right? Is there any way to do this once in a common hgrc file? – Ken Morse Sep 7 2010 at 20:55
These instructions are for separate repos in FogBugz and separate hgrc files with the repo paths. If you used one repo in Fogbugz, you could probably put this in your main mercurial.ini but I haven't tried it – adambox Sep 15 2010 at 15:00
2

Our central Mercurial repository sits on a server that has no internet access to our On Demand FogBugz instance, so the standard approach didn't work for us. Instead, we use the outgoing hook in each local repository.

For example:

[hooks]
outgoing = python:C:\Program Files\FogBugz\fogbugz.py:hook

[fogbugz]
host=https://xxx.fogbugz.com

[web]
baseurl=http://xxx:8000
link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.