Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
53ce1b0b
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
53ce1b0b
编写于
6月 26, 2017
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://github.com/matthewshirley/vscode
into matthewshirley-master
上级
7b90f16e
42ab4c41
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
53 addition
and
2 deletion
+53
-2
extensions/git/package.json
extensions/git/package.json
+14
-0
extensions/git/package.nls.json
extensions/git/package.nls.json
+1
-0
extensions/git/src/commands.ts
extensions/git/src/commands.ts
+26
-1
extensions/git/src/git.ts
extensions/git/src/git.ts
+8
-1
extensions/git/src/model.ts
extensions/git/src/model.ts
+4
-0
未找到文件。
extensions/git/package.json
浏览文件 @
53ce1b0b
...
...
@@ -192,6 +192,11 @@
"title"
:
"%command.pullRebase%"
,
"category"
:
"Git"
},
{
"command"
:
"git.pullFrom"
,
"title"
:
"%command.pullFrom%"
,
"category"
:
"Git"
},
{
"command"
:
"git.push"
,
"title"
:
"%command.push%"
,
...
...
@@ -325,6 +330,10 @@
"command"
:
"git.pullRebase"
,
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command"
:
"git.pullFrom"
,
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command"
:
"git.push"
,
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
...
...
@@ -377,6 +386,11 @@
"group"
:
"1_sync"
,
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command"
:
"git.pullFrom"
,
"group"
:
"1_sync"
,
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command"
:
"git.push"
,
"group"
:
"1_sync"
,
...
...
extensions/git/package.nls.json
浏览文件 @
53ce1b0b
...
...
@@ -25,6 +25,7 @@
"command.merge"
:
"Merge Branch..."
,
"command.pull"
:
"Pull"
,
"command.pullRebase"
:
"Pull (Rebase)"
,
"command.pullFrom"
:
"Pull from..."
,
"command.push"
:
"Push"
,
"command.pushTo"
:
"Push to..."
,
"command.sync"
:
"Sync"
,
...
...
extensions/git/src/commands.ts
浏览文件 @
53ce1b0b
...
...
@@ -834,6 +834,31 @@ export class CommandCenter {
await
this
.
model
.
pullWithRebase
();
}
@
command
(
'
git.pullFrom
'
)
async
pullFrom
():
Promise
<
void
>
{
const
remotes
=
this
.
model
.
remotes
;
if
(
remotes
.
length
===
0
)
{
window
.
showWarningMessage
(
localize
(
'
no remotes to pull
'
,
"
Your repository has no remotes configured to pull from.
"
));
return
;
}
const
picks
=
remotes
.
map
(
r
=>
({
label
:
r
.
name
,
description
:
r
.
url
}));
const
placeHolder
=
localize
(
'
pick remote pull
'
,
"
Pick a remote to pull from
"
);
const
pickRemote
=
await
window
.
showQuickPick
(
picks
,
{
placeHolder
});
const
pickBranch
=
await
window
.
showInputBox
({
prompt
:
localize
(
'
pick pull branch
'
,
"
Type a branch to pull
"
),
ignoreFocusOut
:
true
});
if
(
!
pickRemote
||
!
pickBranch
)
{
return
;
}
this
.
model
.
pullFrom
(
false
,
pickRemote
.
label
,
pickBranch
);
}
@
command
(
'
git.push
'
)
async
push
():
Promise
<
void
>
{
const
remotes
=
this
.
model
.
remotes
;
...
...
@@ -1017,4 +1042,4 @@ export class CommandCenter {
dispose
():
void
{
this
.
disposables
.
forEach
(
d
=>
d
.
dispose
());
}
}
\ No newline at end of file
}
extensions/git/src/git.ts
浏览文件 @
53ce1b0b
...
...
@@ -290,6 +290,8 @@ function getGitErrorCode(stderr: string): string | undefined {
return
GitErrorCodes
.
CantAccessRemote
;
}
else
if
(
/branch '.+' is not fully merged/
.
test
(
stderr
))
{
return
GitErrorCodes
.
BranchNotFullyMerged
;
}
else
if
(
/Couldn
\'
t find remote ref/
.
test
(
stderr
))
{
return
GitErrorCodes
.
CantAccessRemote
;
}
return
void
0
;
...
...
@@ -748,13 +750,18 @@ export class Repository {
}
}
async
pull
(
rebase
?:
boolean
):
Promise
<
void
>
{
async
pull
(
rebase
?:
boolean
,
remote
?:
string
,
branch
?:
string
):
Promise
<
void
>
{
const
args
=
[
'
pull
'
];
if
(
rebase
)
{
args
.
push
(
'
-r
'
);
}
if
(
remote
&&
branch
)
{
args
.
push
(
remote
);
args
.
push
(
branch
);
}
try
{
await
this
.
run
(
args
);
}
catch
(
err
)
{
...
...
extensions/git/src/model.ts
浏览文件 @
53ce1b0b
...
...
@@ -501,6 +501,10 @@ export class Model implements Disposable {
await
this
.
run
(
Operation
.
Push
,
()
=>
this
.
repository
.
push
());
}
async
pullFrom
(
rebase
?:
boolean
,
remote
?:
string
,
branch
?:
string
):
Promise
<
void
>
{
await
this
.
run
(
Operation
.
Pull
,
()
=>
this
.
repository
.
pull
(
rebase
,
remote
,
branch
));
}
async
pushTo
(
remote
?:
string
,
name
?:
string
,
setUpstream
:
boolean
=
false
):
Promise
<
void
>
{
await
this
.
run
(
Operation
.
Push
,
()
=>
this
.
repository
.
push
(
remote
,
name
,
setUpstream
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录