get the tip revision informations from mercurial API
Question: How can I get the tip revision informations of a remote mercurial repository
from a python script?

I want something like:`hg tip`. AFAIK hg commands needs a local repository.

I found another approach with mercurial API : [List remote branches in
Mercurial](http://stackoverflow.com/questions/4296636/list-remote-branches-in-
mercurial). But I can't find a documentation on mercurial API to go further
this way.

Any help would be very much appreciated.


Answer: It works similar to the second answer in your link ([List remote branches in
Mercurial](http://stackoverflow.com/questions/4296636/list-remote-branches-in-
mercurial)):

    
    
    from mercurial import ui, hg, node
    
    peer = hg.peer(ui.ui(), {}, 'http://hg.python.org/cpython')
    print node.short(peer.lookup("tip"))
    

I've tested this with mercurial 2.3.2, for more information you might want to
take a look at wireproto.py (class wirepeer).

