Kiln: The pinnacle of FogBugz and Mercurial Integration (A Quick Sales Pitch)

We don’t mean to toot our own horn… but “Beep! Beep!” Built with Mercurial (and Git!), Kiln is our answer to source code control and bug tracker integration. Go have a look!

But, one of our users may (and did) ask, “Why on Earth should I pay you for Kiln when I can just download Mercurial for free?” Benjamin Pollack makes about the best argument you’ll ever see on the matter in the above link. But here’s the summary:

  • Hosting and Central Repository Control: Kiln lets you access, organize, and browse your repository. Not to mention Kiln makes collaboration a breeze! All of that without giving up the benefits of using a Distributed VCS.
  • Code Reviews: A critical and oft-ignored element of development. Kiln makes it easy to request, receive, and complete code reviews. It really is first-class.
  • FogBugz Integration: In the instructions below you will see how you can integrate FogBugz with other version control systems. However, this integration pales in comparison to what Kiln can bring you. Take a look at what Kiln can add to FogBugz.

Other Forms of Source Control Integration for Fogbugz

Whether you’re using SVN, Mercurial, Perforce, or most anything else, Source Control Integration in FogBugz is straightforward. Using hook scripts downloaded via the UI, your source control system will pickup any “BugzID: 123” comment when you commit a change. The script places an entry in the FogBugz CVS table, which is used to display the check-in information when you view the case in the UI. Using the templates in Admin -> Source Control, the case provides links to logs and diffs.

FogBugz can be set up to work together tightly with most source control systems. When you commit a bug fix to source control, you simply type the case number that you’re fixing. The integration scripts see this and create bidirectional links:

  1. From the FogBugz case to the source control history and diffs
  2. From the source control system to the FogBugz case.

The benefits:

  • You can implement a code-review process. Simply assign a case to the code reviewer. They click on the links to see the diffs in the source control system and review them.
  • It’s easy to find out how a bug was fixed by jumping straight to the source code change.
  • When you’re looking at the changes made in the source code and wondering why they were made, you can quickly jump to the bug they were intended to fix.

Before you can start using source control integration, you will need to make a few configuration changes to FogBugz and your source control system so they can talk to each other. The set up for each Source Control system is a bit different, as well as the mechanism for entering a case number when you commit changes. The list below should help you get your particular Source Control System working with FogBugz:

If you don’t already have source control, we recommend checking out Kiln which integrates with FogBugz right out of the box.

Using Source Control Integration

When you have everything setup, source control integration in FogBugz allows you to associated changes you commit with a given case or cases. When you commit your changes in VCS, your hook script will look for something in your commit message that gives it a case number. For the scripts we distribute, the format is “BugzID: XYZ” where XYZ is a case number. The hook script then posts the info to FogBugz.

When you look at the case you referenced (number XYZ) in FogBugz, you will see a link on the left side of the case, “checkins”.

checkins link

When you click the link, a pop-up dialog appears, showing all of the files and revisions committed against the case.

checkins dialog

Based on your configured URLs in Admin -> Source Control, the file paths and revision numbers will link to an external system to show you file and diff views.