def export(self, directory, revision=None):
<EOL>directory = os.path.abspath(directory)<EOL>self.create()<EOL>timer = Timer()<EOL>revision = revision or self.default_revision<EOL>logger.info("<STR_LIT>", revision, format_path(self.local), directory)<EOL>self.context.execute('<STR_LIT>', '<STR_LIT>', directory)<EOL>self.context.execute(*self.get_export_command(directory, revision))<EOL>logger.debug("<STR_LIT>", timer, self.friendly_name)<EOL>
Export the complete tree from the local version control repository.

:param directory: The directory where the tree should be exported
                  (a string).
:param revision: The revision to export (a string or :data:`None`,
                 defaults to :attr:`default_revision`).