def get_revision_sha(self, dest, rev):
<EOL>output = self.run_command(['<STR_LIT>', rev], cwd=dest,<EOL>show_stdout=False, on_returncode='<STR_LIT:ignore>')<EOL>refs = {}<EOL>for line in output.strip().splitlines():<EOL><INDENT>try:<EOL><INDENT>sha, ref = line.split()<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(line))<EOL><DEDENT>refs[ref] = sha<EOL><DEDENT>branch_ref = '<STR_LIT>'.format(rev)<EOL>tag_ref = '<STR_LIT>'.format(rev)<EOL>sha = refs.get(branch_ref)<EOL>if sha is not None:<EOL><INDENT>return (sha, True)<EOL><DEDENT>sha = refs.get(tag_ref)<EOL>return (sha, False)<EOL>
Return (sha_or_none, is_branch), where sha_or_none is a commit hash
if the revision names a remote branch or tag, otherwise None.

Args:
  dest: the repository directory.
  rev: the revision name.