Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2a86f91d
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,发现更多精彩内容 >>
提交
2a86f91d
编写于
4月 20, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip: adopt ipc channels in git world
上级
a2c64f71
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
67 addition
and
1 deletion
+67
-1
src/vs/workbench/parts/git/common/gitIpc.ts
src/vs/workbench/parts/git/common/gitIpc.ts
+34
-0
src/vs/workbench/parts/git/electron-browser/electronGitService.ts
...orkbench/parts/git/electron-browser/electronGitService.ts
+1
-1
src/vs/workbench/parts/git/node/rawGitService.ts
src/vs/workbench/parts/git/node/rawGitService.ts
+32
-0
未找到文件。
src/vs/workbench/parts/git/common/gitIpc.ts
0 → 100644
浏览文件 @
2a86f91d
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
RawServiceState
,
IRawStatus
,
IPushOptions
}
from
'
./git
'
;
export
interface
IGitChannel
extends
IChannel
{
call
(
command
:
'
getVersion
'
):
TPromise
<
string
>
;
call
(
command
:
'
serviceState
'
):
TPromise
<
RawServiceState
>
;
call
(
command
:
'
status
'
):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
init
'
):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
add
'
,
filesPaths
?:
string
[]):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
stage
'
,
filePath
:
string
,
content
:
string
):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
branch
'
,
name
:
string
,
checkout
?:
boolean
):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
checkout
'
,
treeish
?:
string
,
filePaths
?:
string
[]):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
clean
'
,
filePaths
:
string
[]):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
undo
'
):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
reset
'
,
treeish
:
string
,
hard
?:
boolean
):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
revertFiles
'
,
treeish
:
string
,
filePaths
?:
string
[]):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
fetch
'
):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
pull
'
,
rebase
?:
boolean
):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
push
'
,
remote
?:
string
,
name
?:
string
,
options
?:
IPushOptions
):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
sync
'
):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
commit
'
,
message
:
string
,
amend
?:
boolean
,
stage
?:
boolean
):
TPromise
<
IRawStatus
>
;
call
(
command
:
'
detectMimetypes
'
,
path
:
string
,
treeish
?:
string
):
TPromise
<
string
[]
>
;
call
(
command
:
'
show
'
,
path
:
string
,
treeish
?:
string
):
TPromise
<
string
>
;
call
(
command
:
'
onOutput
'
):
TPromise
<
void
>
;
call
(
command
:
string
,
...
args
:
any
[]):
TPromise
<
any
>
;
}
src/vs/workbench/parts/git/electron-browser/electronGitService.ts
浏览文件 @
2a86f91d
...
...
@@ -139,7 +139,7 @@ function createNativeRawGitService(workspaceRoot: string, path: string, defaultE
}
);
return
client
.
getChannel
(
'
GitService
'
,
RawGitService
);
return
client
.
getChannel
(
'
git
'
);
},
()
=>
new
UnavailableRawGitService
());
}
...
...
src/vs/workbench/parts/git/node/rawGitService.ts
浏览文件 @
2a86f91d
...
...
@@ -10,6 +10,7 @@ import mime = require('vs/base/node/mime');
import
pfs
=
require
(
'
vs/base/node/pfs
'
);
import
{
Repository
,
GitError
}
from
'
vs/workbench/parts/git/node/git.lib
'
;
import
{
IRawGitService
,
RawServiceState
,
IRawStatus
,
IHead
,
GitErrorCodes
,
IPushOptions
}
from
'
vs/workbench/parts/git/common/git
'
;
import
{
IGitChannel
}
from
'
vs/workbench/parts/git/common/gitIpc
'
;
export
class
RawGitService
implements
IRawGitService
{
...
...
@@ -262,4 +263,35 @@ export class DelayedRawGitService implements IRawGitService {
public
onOutput
():
Promise
{
return
this
.
raw
.
then
(
raw
=>
raw
.
onOutput
());
}
}
export
class
GitChannel
implements
IGitChannel
{
constructor
(
private
rawGitService
:
IRawGitService
)
{
}
call
(
command
:
string
,
...
args
:
any
[]):
TPromise
<
any
>
{
switch
(
command
)
{
case
'
getVersion
'
:
return
this
.
rawGitService
.
getVersion
();
case
'
serviceState
'
:
return
this
.
rawGitService
.
serviceState
();
case
'
status
'
:
return
this
.
rawGitService
.
status
();
case
'
status
'
:
return
this
.
rawGitService
.
status
();
case
'
init
'
:
return
this
.
rawGitService
.
init
();
case
'
add
'
:
return
this
.
rawGitService
.
add
(
args
[
0
]);
case
'
stage
'
:
return
this
.
rawGitService
.
stage
(
args
[
0
],
args
[
1
]);
case
'
branch
'
:
return
this
.
rawGitService
.
branch
(
args
[
0
],
args
[
1
]);
case
'
checkout
'
:
return
this
.
rawGitService
.
checkout
(
args
[
0
],
args
[
1
]);
case
'
clean
'
:
return
this
.
rawGitService
.
clean
(
args
[
0
]);
case
'
undo
'
:
return
this
.
rawGitService
.
undo
();
case
'
reset
'
:
return
this
.
rawGitService
.
reset
(
args
[
0
],
args
[
1
]);
case
'
revertFiles
'
:
return
this
.
rawGitService
.
revertFiles
(
args
[
0
],
args
[
1
]);
case
'
fetch
'
:
return
this
.
rawGitService
.
fetch
();
case
'
pull
'
:
return
this
.
rawGitService
.
pull
(
args
[
0
]);
case
'
push
'
:
return
this
.
rawGitService
.
push
(
args
[
0
],
args
[
1
],
args
[
2
]);
case
'
sync
'
:
return
this
.
rawGitService
.
sync
();
case
'
commit
'
:
return
this
.
rawGitService
.
commit
(
args
[
0
],
args
[
1
],
args
[
2
]);
case
'
detectMimetypes
'
:
return
this
.
rawGitService
.
detectMimetypes
(
args
[
0
],
args
[
1
]);
case
'
show
'
:
return
this
.
rawGitService
.
show
(
args
[
0
],
args
[
1
]);
case
'
onOutput
'
:
return
this
.
rawGitService
.
onOutput
();
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录