def version_control():
curdir_contents = os.listdir('<STR_LIT:.>')<EOL>if '<STR_LIT>' in curdir_contents:<EOL><INDENT>return hg.Hg()<EOL><DEDENT>elif '<STR_LIT>' in curdir_contents:<EOL><INDENT>return git.Git()<EOL><DEDENT>else:<EOL><INDENT>logger.critical('<STR_LIT>')<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>
Return an object that provides the version control interface based
    on the detected version control system.