How to set up Mercurial Integration
Mercurial plugin can be used to update entities in TargetProcess. You can update entity states and time spent/remaining as you enter comments when doing a Mercurial commit.
Also, Mercurial integration requires Mercurial Client installed on server side (i.e TortoiseHg).
To set up the Mercurial integration, go to Settings→ System Settings → Plugins, and add a new Mercurial Integration profile:

By default, users in Mercurial and TargetProcess are mapped automatically if one of the following is true:
- Mercurial email = TP email
- Mercurial Name = TP Full Name
- Mercurial name = TP Login
Otherwise, you need to map users:

As soon as the profile is created, TargetProcess will import Mercurial revisions starting from the date you’ve specified. This can take several minutes.
You can track the import status in the log:

Now, as you do a Mercurial commit, just add a comment in any of these formats:
| Action | Commit message |
|---|---|
| Change entity states | #ID (or id:ID) state:fixed |
| Add comments to defect | #ID comment: text of your comment here comment: this is a second multi-line comment row1 row2 |
| Add spent time | #ID time:1 |
| Add spent and remaining time | #ID time:4:8 |
| Update several entities at a time | #ID, #ID comment: will not be fixed state: invalid time:0.5 |
| All possible actions | #456, #887 state:done time:3:0 comment:whoa! Everything is completed! |

In this example, as soon as the commit is done, the status of the entity with ID=584 will be changed to Done, and the comment “Should be included to the current release,” spent time = 1 hour and remaining time = 2 hours will be added to the entity.
You can see all the updates from Mercurial in the Source tab:

Make sure you enter comments in the correct format as shown above. Neither comments, nor time entries, nor the states will update if the format is incorrect.