开发者

How can I integrate bitbucket.org's Issues with issue tracking in TortoiseHg?

开发者 https://www.devze.com 2023-01-20 14:34 出处:网络
I can not find any documentation for this开发者_StackOverflow - is it possible?The help for the fields you\'ve found in the TortoiseHg config dialog (thg userconfig) is:

I can not find any documentation for this开发者_StackOverflow - is it possible?


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.


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}/
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号