提交 33481c66 编写于 作者: C Chris Jerdonek

Return early in VersionControl.check_destination() if no prompt.

上级 3273ba6d
......@@ -301,8 +301,6 @@ class VersionControl(object):
if not os.path.exists(dest):
return True
checkout = False
prompt = False
rev_display = rev_options.to_display()
if os.path.exists(os.path.join(dest, self.dirname)):
existing_url = self.get_url(dest)
......@@ -322,9 +320,9 @@ class VersionControl(object):
)
self.update(dest, rev_options)
else:
logger.info(
'Skipping because already up-to-date.')
else:
logger.info('Skipping because already up-to-date.')
return False
logger.warning(
'%s %s in %s exists with URL %s',
self.name,
......@@ -343,15 +341,14 @@ class VersionControl(object):
)
prompt = ('(i)gnore, (w)ipe, (b)ackup ', ('i', 'w', 'b'))
if prompt:
logger.warning(
'The plan is to install the %s repository %s',
self.name,
url,
)
response = ask_path_exists('What to do? %s' % prompt[0],
prompt[1])
response = ask_path_exists('What to do? %s' % prompt[0], prompt[1])
checkout = False
if response == 's':
logger.info(
'Switching %s %s to %s%s',
......@@ -377,6 +374,7 @@ class VersionControl(object):
checkout = True
elif response == 'a':
sys.exit(-1)
return checkout
def unpack(self, location):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册