def resolve_revision(self, dest, url, rev_options):
rev = rev_options.arg_rev<EOL>sha, is_branch = self.get_revision_sha(dest, rev)<EOL>if sha is not None:<EOL><INDENT>rev_options = rev_options.make_new(sha)<EOL>rev_options.branch_name = rev if is_branch else None<EOL>return rev_options<EOL><DEDENT>if not looks_like_hash(rev):<EOL><INDENT>logger.warning(<EOL>"<STR_LIT>",<EOL>rev,<EOL>)<EOL><DEDENT>if not rev.startswith('<STR_LIT>'):<EOL><INDENT>return rev_options<EOL><DEDENT>self.run_command(<EOL>['<STR_LIT>', '<STR_LIT>', url] + rev_options.to_args(),<EOL>cwd=dest,<EOL>)<EOL>sha = self.get_revision(dest, rev='<STR_LIT>')<EOL>rev_options = rev_options.make_new(sha)<EOL>return rev_options<EOL>
Resolve a revision to a new RevOptions object with the SHA1 of the
branch, tag, or ref if found.

Args:
  rev_options: a RevOptions object.