def commit(self, commit):
try:<EOL><INDENT>return self._commitData(self.repo.commit(commit))<EOL><DEDENT>except (ValueError, KeyError, BadObject):<EOL><INDENT>if self._repo_info:<EOL><INDENT>raise KeyError("<STR_LIT>" % (commit, str(self._repo_info)))<EOL><DEDENT>else:<EOL><INDENT>raise KeyError("<STR_LIT>" % commit)<EOL><DEDENT><DEDENT>
Get data for a given commit

        Raises KeyError if a commit is not found or not parsed.

        :param commit: repository commit
        :type  commit: string