def using_hg(cwd):
try:<EOL><INDENT>hg_log = shell_out(["<STR_LIT>",   "<STR_LIT>"], cwd=cwd)<EOL>return True<EOL><DEDENT>except (CalledProcessError, OSError):<EOL><INDENT>return False<EOL><DEDENT>
Test whether the directory cwd is contained in a mercurial
    repository.