code: def using_hg(cwd):
      
      try:
          hg_log = shell_out(["hg",   "log"], cwd=cwd)
          return True
      except (CalledProcessError, OSError):
          return False
docs: Test whether the directory cwd is contained in a mercurial
      repository.