4

So I understand that Mercurial adds a comment into the Perforce changelist description which contains the hash of the HG commit (something akin to {{mercurial f413e67c0df7ec53e58e43121c5ffc85f315765a}}).

What I was wondering, does it matter where in the description that tag is contained?

The Perforce repository that I am pushing too has very strict commit guidelines, and the description has to be formed in an exact way (each commit has an identical layout of code reviewers, JIRA issues mentioned, etc).

Am I ok to have the tag in there as is, but also add in all the extra information I am required to have?

Tuxdude
  • 47,485
  • 15
  • 109
  • 110
sheredom
  • 65
  • 3

2 Answers2

1

I happened to be looking into this code right now and googling things related and came across your question. It just searches for a regex and as long as it matches {{mercurial <hash>}} somewhere in the comment it will be fine.

To be specific here's the regex:

'{{mercurial (([0-9a-f]{40})(:([0-9a-f]{40}))?)}}'

And it just calls search for that regex.

Matt Price
  • 43,887
  • 9
  • 38
  • 44
0

From trial and error, I believe I have answered my own question.

I have moved the tag from being inline in the commit message, to the start, and to the end of the description and the result is the same - Perfarce correctly picks the changelist using just the tag, no matter where it appears in the description.

sheredom
  • 65
  • 3