18

I can not find any documentation for this - is it possible?

  • I'm not sure I understand your question as TortoiseHg doesn't do "issue tracking". Are you looking to access a bitbucket repository from within TortoiseHg? – Nick Pierpoint Nov 08 '10 at 10:14
  • 1
    In the settings of TortoiseHg there is a section called "Issue Tracking". What tools can I use for this? Can I somehow integrate this with the BitBucket issue tracking? – Soren Beck Jensen Nov 18 '10 at 11:22

2 Answers2

15

The help for the fields you've found in the TortoiseHg config dialog (thg userconfig) is:

  • Issue Regex field:

    Defines the regex to match when picking up issue numbers.

  • Issue Link field:

    Defines the command to run when an issue number is recognized. You may include groups in issue.regex, and corresponding {n} tokens in issue.link (where n is a non-negative integer). {0} refers to the entire string matched by issue.regex, while {1} refers to the first group and so on. If no {n} tokensare found in issue.link, the entire matched string is appended instead.

In other words, if you configure them like

[tortoisehg]
issue.regex = [Ii]ssue(\d+)
issue.link = https://www.mercurial-scm.org/bts/issue{1}

then you will have a setting suitable for the Mercurial project itself: if a commit message contains the text "issueNNN" or "IssueNNN", then TortoiseHg will now make that a link to the Mercurial bug tracker for Issue NNN.

For Bitbucket's issue tracker you will want a link like

https://bitbucket.org/<user>/<repo>/issue/{1}/

and then capture the issue number in the regular expression. This works because Bitbucket is smart enough to ignore the rest of the URL after the issue number -- you can write whatever you want there, or write nothing as above.

Very simple functionality, but also quite useful when you often lookup bugs based on the commit messages.

Community
  • 1
  • 1
Martin Geisler
  • 72,968
  • 25
  • 171
  • 229
11

The following configuration will work for bitbucket when you are taging your issues with "#" like " fixed #123 and #124 "

[tortoisehg]
issue.regex = #(\d+)
issue.link = https://bitbucket.org/yourusername/yourprojectname/issue/{1}/
Coenie Richards
  • 568
  • 12
  • 28