Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
33481c66
P
pip
项目概览
镜像
/
Python_Packaging_Authority
/
pip
11 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
pip
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
33481c66
编写于
6月 30, 2018
作者:
C
Chris Jerdonek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Return early in VersionControl.check_destination() if no prompt.
上级
3273ba6d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
43 addition
and
45 deletion
+43
-45
news/07E9718B-0155-413F-AC2A-1B75AA2934BC.trivial
news/07E9718B-0155-413F-AC2A-1B75AA2934BC.trivial
+0
-0
src/pip/_internal/vcs/__init__.py
src/pip/_internal/vcs/__init__.py
+43
-45
未找到文件。
news/07E9718B-0155-413F-AC2A-1B75AA2934BC.trivial
0 → 100644
浏览文件 @
33481c66
src/pip/_internal/vcs/__init__.py
浏览文件 @
33481c66
...
...
@@ -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,18 +320,18 @@ class VersionControl(object):
)
self
.
update
(
dest
,
rev_options
)
else
:
logger
.
info
(
'Skipping because already up-to-date.'
)
else
:
logger
.
warning
(
'%s %s in %s exists with URL %s'
,
self
.
name
,
self
.
repo_name
,
display_path
(
dest
),
existing_url
,
)
prompt
=
(
'(s)witch, (i)gnore, (w)ipe, (b)ackup '
,
(
's'
,
'i'
,
'w'
,
'b'
))
logger
.
info
(
'Skipping because already up-to-date.'
)
return
False
logger
.
warning
(
'%s %s in %s exists with URL %s'
,
self
.
name
,
self
.
repo_name
,
display_path
(
dest
),
existing_url
,
)
prompt
=
(
'(s)witch, (i)gnore, (w)ipe, (b)ackup '
,
(
's'
,
'i'
,
'w'
,
'b'
))
else
:
logger
.
warning
(
'Directory %s already exists, and is not a %s %s.'
,
...
...
@@ -343,40 +341,40 @@ 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
,
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
])
checkout
=
False
if
response
==
's'
:
logger
.
info
(
'Switching %s %s to %s%s'
,
self
.
repo_name
,
display_path
(
dest
),
url
,
rev_display
,
)
response
=
ask_path_exists
(
'What to do? %s'
%
prompt
[
0
],
prompt
[
1
])
self
.
switch
(
dest
,
url
,
rev_options
)
elif
response
==
'i'
:
# do nothing
pass
elif
response
==
'w'
:
logger
.
warning
(
'Deleting %s'
,
display_path
(
dest
))
rmtree
(
dest
)
checkout
=
True
elif
response
==
'b'
:
dest_dir
=
backup_dir
(
dest
)
logger
.
warning
(
'Backing up %s to %s'
,
display_path
(
dest
),
dest_dir
,
)
shutil
.
move
(
dest
,
dest_dir
)
checkout
=
True
elif
response
==
'a'
:
sys
.
exit
(
-
1
)
if
response
==
's'
:
logger
.
info
(
'Switching %s %s to %s%s'
,
self
.
repo_name
,
display_path
(
dest
),
url
,
rev_display
,
)
self
.
switch
(
dest
,
url
,
rev_options
)
elif
response
==
'i'
:
# do nothing
pass
elif
response
==
'w'
:
logger
.
warning
(
'Deleting %s'
,
display_path
(
dest
))
rmtree
(
dest
)
checkout
=
True
elif
response
==
'b'
:
dest_dir
=
backup_dir
(
dest
)
logger
.
warning
(
'Backing up %s to %s'
,
display_path
(
dest
),
dest_dir
,
)
shutil
.
move
(
dest
,
dest_dir
)
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录