def obtain(self, dest):<EOL>
url, rev_options = self.get_url_rev_options(self.url)<EOL>if not os.path.exists(dest):<EOL><INDENT>self.fetch_new(dest, url, rev_options)<EOL>return<EOL><DEDENT>rev_display = rev_options.to_display()<EOL>if self.is_repository_directory(dest):<EOL><INDENT>existing_url = self.get_remote_url(dest)<EOL>if self.compare_urls(existing_url, url):<EOL><INDENT>logger.debug(<EOL>'<STR_LIT>',<EOL>self.repo_name.title(),<EOL>display_path(dest),<EOL>url,<EOL>)<EOL>if not self.is_commit_id_equal(dest, rev_options.rev):<EOL><INDENT>logger.info(<EOL>'<STR_LIT>',<EOL>display_path(dest),<EOL>self.repo_name,<EOL>rev_display,<EOL>)<EOL>self.update(dest, url, rev_options)<EOL><DEDENT>else:<EOL><INDENT>logger.info('<STR_LIT>')<EOL><DEDENT>return<EOL><DEDENT>logger.warning(<EOL>'<STR_LIT>',<EOL>self.name,<EOL>self.repo_name,<EOL>display_path(dest),<EOL>existing_url,<EOL>)<EOL>prompt = ('<STR_LIT>',<EOL>('<STR_LIT:s>', '<STR_LIT:i>', '<STR_LIT:w>', '<STR_LIT:b>'))<EOL><DEDENT>else:<EOL><INDENT>logger.warning(<EOL>'<STR_LIT>',<EOL>dest,<EOL>self.name,<EOL>self.repo_name,<EOL>)<EOL>prompt = ('<STR_LIT>',  <EOL>('<STR_LIT:i>', '<STR_LIT:w>', '<STR_LIT:b>'))<EOL><DEDENT>logger.warning(<EOL>'<STR_LIT>',<EOL>self.name,<EOL>url,<EOL>)<EOL>response = ask_path_exists('<STR_LIT>' % prompt[<NUM_LIT:0>], prompt[<NUM_LIT:1>])<EOL>if response == '<STR_LIT:a>':<EOL><INDENT>sys.exit(-<NUM_LIT:1>)<EOL><DEDENT>if response == '<STR_LIT:w>':<EOL><INDENT>logger.warning('<STR_LIT>', display_path(dest))<EOL>rmtree(dest)<EOL>self.fetch_new(dest, url, rev_options)<EOL>return<EOL><DEDENT>if response == '<STR_LIT:b>':<EOL><INDENT>dest_dir = backup_dir(dest)<EOL>logger.warning(<EOL>'<STR_LIT>', display_path(dest), dest_dir,<EOL>)<EOL>shutil.move(dest, dest_dir)<EOL>self.fetch_new(dest, url, rev_options)<EOL>return<EOL><DEDENT>if response == '<STR_LIT:s>':<EOL><INDENT>logger.info(<EOL>'<STR_LIT>',<EOL>self.repo_name,<EOL>display_path(dest),<EOL>url,<EOL>rev_display,<EOL>)<EOL>self.switch(dest, url, rev_options)<EOL><DEDENT>
Install or update in editable mode the package represented by this
VersionControl object.

Args:
  dest: the repository directory in which to install or update.