def checkout(self, revision=None, clean=False):
<EOL>self.create()<EOL>self.ensure_working_tree()<EOL>revision = revision or self.default_revision<EOL>logger.info("<STR_LIT>", revision, format_path(self.local))<EOL>self.context.execute(*self.get_checkout_command(revision, clean))<EOL>
Update the working tree of the local repository to the specified revision.

:param revision: The revision to check out (a string,
                 defaults to :attr:`default_revision`).
:param clean: :data:`True` to discard changes in the working tree,
              :data:`False` otherwise.