Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
13484ae9
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,发现更多精彩内容 >>
提交
13484ae9
编写于
6月 20, 2017
作者:
K
Krzysztof Cieślak
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add commands
上级
4cd45c49
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
85 addition
and
1 deletion
+85
-1
extensions/git/package.json
extensions/git/package.json
+43
-1
extensions/git/package.nls.json
extensions/git/package.nls.json
+3
-0
extensions/git/src/commands.ts
extensions/git/src/commands.ts
+39
-0
未找到文件。
extensions/git/package.json
浏览文件 @
13484ae9
...
@@ -251,6 +251,21 @@
...
@@ -251,6 +251,21 @@
"command"
:
"git.ignore"
,
"command"
:
"git.ignore"
,
"title"
:
"%command.ignore%"
,
"title"
:
"%command.ignore%"
,
"category"
:
"Git"
"category"
:
"Git"
},
{
"command"
:
"git.stash"
,
"title"
:
"%command.stash%"
,
"category"
:
"Git"
},
{
"command"
:
"git.stashPop"
,
"title"
:
"%command.stashPop%"
,
"category"
:
"Git"
},
{
"command"
:
"git.stashPopLatest"
,
"title"
:
"%command.stashPopLatest%"
,
"category"
:
"Git"
}
}
],
],
"menus"
:
{
"menus"
:
{
...
@@ -402,6 +417,18 @@
...
@@ -402,6 +417,18 @@
{
{
"command"
:
"git.showOutput"
,
"command"
:
"git.showOutput"
,
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command"
:
"git.stash"
,
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command"
:
"git.stashPop"
,
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command"
:
"git.stashPopLatest"
,
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
}
}
],
],
"scm/title"
:
[
"scm/title"
:
[
...
@@ -501,7 +528,22 @@
...
@@ -501,7 +528,22 @@
},
},
{
{
"command"
:
"git.showOutput"
,
"command"
:
"git.showOutput"
,
"group"
:
"5_output"
,
"group"
:
"6_output"
,
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command"
:
"git.stash"
,
"group"
:
"5_stash"
,
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command"
:
"git.stashPop"
,
"group"
:
"5_stash"
,
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command"
:
"git.stashPopLatest"
,
"group"
:
"5_stash"
,
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
"when"
:
"config.git.enabled && scmProvider == git && gitState == idle"
}
}
],
],
...
...
extensions/git/package.nls.json
浏览文件 @
13484ae9
...
@@ -37,6 +37,9 @@
...
@@ -37,6 +37,9 @@
"command.publish"
:
"Publish Branch"
,
"command.publish"
:
"Publish Branch"
,
"command.showOutput"
:
"Show Git Output"
,
"command.showOutput"
:
"Show Git Output"
,
"command.ignore"
:
"Add File to .gitignore"
,
"command.ignore"
:
"Add File to .gitignore"
,
"command.stash"
:
"Stash"
,
"command.stashPop"
:
"Stash Pop"
,
"command.stashPopLatest"
:
"Stash Pop Latest"
,
"config.enabled"
:
"Whether git is enabled"
,
"config.enabled"
:
"Whether git is enabled"
,
"config.path"
:
"Path to the git executable"
,
"config.path"
:
"Path to the git executable"
,
"config.autorefresh"
:
"Whether auto refreshing is enabled"
,
"config.autorefresh"
:
"Whether auto refreshing is enabled"
,
...
...
extensions/git/src/commands.ts
浏览文件 @
13484ae9
...
@@ -1092,6 +1092,45 @@ export class CommandCenter {
...
@@ -1092,6 +1092,45 @@ export class CommandCenter {
await
this
.
model
.
ignore
(
uris
);
await
this
.
model
.
ignore
(
uris
);
}
}
@
command
(
'
git.stash
'
)
async
stash
()
:
Promise
<
void
>
{
const
noUnstagedChanges
=
this
.
model
.
workingTreeGroup
.
resources
.
length
===
0
;
if
(
noUnstagedChanges
){
window
.
showInformationMessage
(
localize
(
'
no changes stash
'
,
"
There are no changes to stash.
"
));
return
;
}
return
await
this
.
model
.
stash
();
}
@
command
(
'
git.stashPop
'
)
async
stashPop
():
Promise
<
void
>
{
const
noStashes
=
this
.
model
.
stashes
.
length
===
0
;
if
(
noStashes
){
window
.
showInformationMessage
(
localize
(
'
no stashes
'
,
"
There are no stashes to restore.
"
));
return
;
}
const
picks
=
this
.
model
.
stashes
.
map
(
r
=>
`#
${
r
.
id
}
:
${
r
.
description
}
`
);
const
placeHolder
=
localize
(
'
pick stash
'
,
"
Pick a stash
"
);
const
choice
=
await
window
.
showQuickPick
(
picks
,
{
placeHolder
});
if
(
!
choice
)
{
return
;
}
return
await
this
.
model
.
stash
(
true
,
choice
);
}
@
command
(
'
git.stashPopLatest
'
)
async
stashPopLatest
():
Promise
<
void
>
{
const
noStashes
=
this
.
model
.
stashes
.
length
===
0
;
if
(
noStashes
){
window
.
showInformationMessage
(
localize
(
'
no stashes
'
,
"
There are no stashes to restore.
"
));
return
;
}
return
await
this
.
model
.
stash
(
true
);
}
private
createCommand
(
id
:
string
,
key
:
string
,
method
:
Function
,
skipModelCheck
:
boolean
):
(...
args
:
any
[])
=>
any
{
private
createCommand
(
id
:
string
,
key
:
string
,
method
:
Function
,
skipModelCheck
:
boolean
):
(...
args
:
any
[])
=>
any
{
const
result
=
(...
args
)
=>
{
const
result
=
(...
args
)
=>
{
if
(
!
skipModelCheck
&&
!
this
.
model
)
{
if
(
!
skipModelCheck
&&
!
this
.
model
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录