def get_hg_revision(repopath):
 try:
  assert osp.isdir(osp.join(repopath, '.hg'))
  proc = programs.run_program('hg', ['id', '-nib', repopath])
  (output, _err) = proc.communicate()
  return tuple(output.decode().strip().split(None, 2))
 except (subprocess.CalledProcessError, AssertionError, AttributeError):
  return (None, None, None)

def get_hg_revision ( repopath ) : try : assert osp . isdir ( osp . join ( repopath , '.hg' ) ) proc = programs . run_program ( 'hg' , [ 'id' , '-nib' , repopath ] ) ( output , _err ) = proc . communicate ( ) return tuple ( output . decode ( ) . strip ( ) . split ( None , 2 ) ) except ( subprocess . CalledProcessError , AssertionError , AttributeError ) : return ( None , None , None )
return mercurial revision for the repository located at repopath result is a tuple .