The mercurial plugin for jenkins makes the MERCURIAL_REVISION
and MERCURIAL_REVISION_NUMBER
variable available to your build scripts. If you include this number in your release, either in a (separate) file or compiled into the program and accessible on the about screen or some other place you should be able to use this number to find the right version of your code.
Also see How to get revision number from Mercurial repository and paste it to NetBeans resource bundle? for tips on getting more info than a single revision number from mercurial.
UPDATE: How to include the revision in your code is dependent on the programming language, compiler and the type of build language you use.