Besides commit statements from hg or git like this:
hg commit -m “fixes #6, resolve ticket #5 and see ticket #9 and ticket #5 in the tracker”
The best is to start with the command, then finish the comment (commands in the middle of a comment are far less reliable).
Command “Verb” Conjugation(s) resolve close close
resolve fix fixfixedfixesfixing resolve resolve resolve
reopen reopen reopen
hold hold hold
wontfix wontfix wontfix invalid invaldate invalidate
You can also use the word “issue” in the middle to just link to an issue like this syntax:
links to issue #1
Finally, you can refer from issues to change sets using a cset syntax:
<<cset 2f2f8d4cae7da0e37a5ffbc81c527cb67cc56015>> where the hex number is from a URL in your commit list (for instance in https://bitbucket.org/jeroenp/fastmm/commits)
Note that linking from changesets to issues often automatically creates a back-link, but that doesn’t always work, and fixing it has very low priority (like many things on BitBucket): Issues getting linked to commits have the wrong link syntax, they show BB-6232 — Bitbucket.