I am using the python mercurial API in my project.
from mercurial import ui, hg, commands
from mercurial.node import hex
user_id = ui.ui()
hg_repo = hg.repository(user_id, '/path/to/repo')
hg_repo.ui.pushbuffer()
some_is_coming = commands.incoming(hg_repo.ui, hg_repo, source='default',
bundle=None, force=False)
if some_is_coming:
output = hg_repo.ui.popbuffer()
In [95]: output
Out[95]: 'comparing with ssh:host-name\nsearching for changes\nchangeset: 1:e74dcb2eb5e1\ntag: tip\nuser: that-is-me\ndate: Fri Nov 06 12:26:53 2015 +0100\nsummary: added input.txt\n\n'
Extracting the short node info e74dcb2eb5e1
will be easy. What I really need, however, is the 40 digit hex revision id. Is there any way to retrieve this information without pulling the repo first?