remote-hg: another case of Postel's law
[git/dscho.git] / git_remote_helpers / hg / util.py
blob2cd54c1ad0223fb9a0d219a85ff3524841724db7
1 #!/usr/bin/env python
3 from mercurial import hg
5 def parseurl(url, heads=[]):
6 url, heads = hg.parseurl(url, heads)
7 if isinstance(heads, tuple) and len(heads) == 2:
8 # hg 1.6 or later
9 _junk, heads = heads
10 if heads:
11 checkout = heads[0]
12 else:
13 checkout = None
14 return url, heads, checkout