Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
fcdc90c7
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,发现更多精彩内容 >>
提交
fcdc90c7
编写于
8月 12, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'bill-mybiz-bill_prev_comm_msg'
上级
0e242679
92efe772
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
65 addition
and
4 deletion
+65
-4
src/vs/workbench/parts/git/browser/gitActions.ts
src/vs/workbench/parts/git/browser/gitActions.ts
+3
-1
src/vs/workbench/parts/git/browser/gitServices.ts
src/vs/workbench/parts/git/browser/gitServices.ts
+4
-0
src/vs/workbench/parts/git/browser/views/changes/changesView.ts
.../workbench/parts/git/browser/views/changes/changesView.ts
+16
-0
src/vs/workbench/parts/git/common/git.ts
src/vs/workbench/parts/git/common/git.ts
+7
-0
src/vs/workbench/parts/git/common/gitIpc.ts
src/vs/workbench/parts/git/common/gitIpc.ts
+7
-1
src/vs/workbench/parts/git/common/noopGitService.ts
src/vs/workbench/parts/git/common/noopGitService.ts
+5
-1
src/vs/workbench/parts/git/node/git.lib.ts
src/vs/workbench/parts/git/node/git.lib.ts
+17
-0
src/vs/workbench/parts/git/node/rawGitService.ts
src/vs/workbench/parts/git/node/rawGitService.ts
+6
-1
未找到文件。
src/vs/workbench/parts/git/browser/gitActions.ts
浏览文件 @
fcdc90c7
...
...
@@ -29,6 +29,7 @@ import { IGitService, IFileStatus, Status, StatusType, ServiceState, IModel, IBr
import
{
IQuickOpenService
}
from
'
vs/workbench/services/quickopen/common/quickOpenService
'
;
import
paths
=
require
(
'
vs/base/common/paths
'
);
import
URI
from
'
vs/base/common/uri
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
function
flatten
(
context
?:
any
,
preferFocus
=
false
):
IFileStatus
[]
{
if
(
!
context
)
{
...
...
@@ -1117,7 +1118,8 @@ export class UndoLastCommitAction extends GitAction {
constructor
(
id
=
UndoLastCommitAction
.
ID
,
label
=
UndoLastCommitAction
.
LABEL
,
@
IGitService
gitService
:
IGitService
@
IGitService
gitService
:
IGitService
,
@
IStorageService
private
storageService
:
IStorageService
)
{
super
(
UndoLastCommitAction
.
ID
,
UndoLastCommitAction
.
LABEL
,
'
git-action undo-last-commit
'
,
gitService
);
}
...
...
src/vs/workbench/parts/git/browser/gitServices.ts
浏览文件 @
fcdc90c7
...
...
@@ -695,6 +695,10 @@ export class GitService extends ee.EventEmitter
return
this
.
raw
.
getCommitTemplate
();
}
public
getCommit
(
ref
:
string
):
winjs
.
TPromise
<
git
.
ICommit
>
{
return
this
.
raw
.
getCommit
(
ref
);
}
public
detectMimetypes
(
path
:
string
,
treeish
:
string
=
'
~
'
):
winjs
.
Promise
{
return
this
.
raw
.
detectMimetypes
(
path
,
treeish
);
}
...
...
src/vs/workbench/parts/git/browser/views/changes/changesView.ts
浏览文件 @
fcdc90c7
...
...
@@ -244,6 +244,14 @@ export class ChangesView extends EventEmitter.EventEmitter implements GitView.IV
}
}
private
onUndoLastCommit
(
commit
:
git
.
ICommit
):
void
{
if
(
this
.
commitInputBox
.
value
)
{
return
;
}
this
.
commitInputBox
.
value
=
commit
.
message
;
}
private
updateCommitInputTemplate
():
void
{
if
(
this
.
commitInputBox
.
value
)
{
return
;
...
...
@@ -401,6 +409,14 @@ export class ChangesView extends EventEmitter.EventEmitter implements GitView.IV
if
(
this
.
commitInputBox
)
{
this
.
commitInputBox
.
disable
();
}
}
else
if
(
operation
.
id
===
git
.
ServiceOperations
.
RESET
)
{
const
promise
=
this
.
gitService
.
getCommit
(
'
HEAD
'
);
const
listener
=
this
.
gitService
.
addListener2
(
git
.
ServiceEvents
.
OPERATION_END
,
e
=>
{
if
(
e
.
operation
.
id
===
git
.
ServiceOperations
.
RESET
&&
!
e
.
error
)
{
promise
.
done
(
c
=>
this
.
onUndoLastCommit
(
c
));
listener
.
dispose
();
}
});
}
}
...
...
src/vs/workbench/parts/git/common/git.ts
浏览文件 @
fcdc90c7
...
...
@@ -54,6 +54,11 @@ export interface IRawStatus {
remotes
:
IRemote
[];
}
export
interface
ICommit
{
hash
:
string
;
message
:
string
;
}
// Model enums
export
enum
StatusType
{
...
...
@@ -287,6 +292,7 @@ export interface IRawGitService {
detectMimetypes
(
path
:
string
,
treeish
?:
string
):
TPromise
<
string
[]
>
;
show
(
path
:
string
,
treeish
?:
string
):
TPromise
<
string
>
;
getCommitTemplate
():
TPromise
<
string
>
;
getCommit
(
ref
:
string
):
TPromise
<
ICommit
>
;
}
export
const
GIT_SERVICE_ID
=
'
gitService
'
;
...
...
@@ -324,6 +330,7 @@ export interface IGitService extends IEventEmitter {
getRunningOperations
():
IGitOperation
[];
getAutoFetcher
():
IAutoFetcher
;
getCommitTemplate
():
TPromise
<
string
>
;
getCommit
(
ref
:
string
):
TPromise
<
ICommit
>
;
}
export
interface
IAskpassService
{
...
...
src/vs/workbench/parts/git/common/gitIpc.ts
浏览文件 @
fcdc90c7
...
...
@@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
IChannel
,
eventToCall
,
eventFromCall
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
Event
from
'
vs/base/common/event
'
;
import
{
IRawGitService
,
RawServiceState
,
IRawStatus
,
IPushOptions
,
IAskpassService
,
ICredentials
,
ServiceState
,
IRawFileStatus
,
IBranch
,
RefType
,
IRef
,
IRemote
}
from
'
./git
'
;
ServiceState
,
IRawFileStatus
,
IBranch
,
RefType
,
IRef
,
IRemote
,
ICommit
}
from
'
./git
'
;
type
ISerializer
<
A
,
B
>
=
{
to
(
a
:
A
):
B
;
from
(
b
:
B
):
A
;
};
...
...
@@ -88,6 +88,7 @@ export interface IGitChannel extends IChannel {
call
(
command
:
'
show
'
,
args
:
[
string
,
string
]):
TPromise
<
string
>
;
call
(
command
:
'
onOutput
'
):
TPromise
<
void
>
;
call
(
command
:
'
getCommitTemplate
'
):
TPromise
<
string
>
;
call
(
command
:
'
getCommit
'
,
ref
:
string
):
TPromise
<
ICommit
>
;
call
(
command
:
string
,
args
:
any
):
TPromise
<
any
>
;
}
...
...
@@ -119,6 +120,7 @@ export class GitChannel implements IGitChannel {
case
'
show
'
:
return
this
.
service
.
then
(
s
=>
s
.
show
(
args
[
0
],
args
[
1
]));
case
'
onOutput
'
:
return
this
.
service
.
then
(
s
=>
eventToCall
(
s
.
onOutput
));
case
'
getCommitTemplate
'
:
return
this
.
service
.
then
(
s
=>
s
.
getCommitTemplate
());
case
'
getCommit
'
:
return
this
.
service
.
then
(
s
=>
s
.
getCommit
(
args
));
}
}
}
...
...
@@ -223,6 +225,10 @@ export class GitChannelClient implements IRawGitService {
getCommitTemplate
():
TPromise
<
string
>
{
return
this
.
channel
.
call
(
'
getCommitTemplate
'
);
}
getCommit
(
ref
:
string
):
TPromise
<
ICommit
>
{
return
this
.
channel
.
call
(
'
getCommit
'
,
ref
);
}
}
export
interface
IAskpassChannel
extends
IChannel
{
...
...
src/vs/workbench/parts/git/common/noopGitService.ts
浏览文件 @
fcdc90c7
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
IRawGitService
,
IRawStatus
,
ServiceState
,
RawServiceState
}
from
'
vs/workbench/parts/git/common/git
'
;
import
{
IRawGitService
,
IRawStatus
,
ServiceState
,
RawServiceState
,
ICommit
}
from
'
vs/workbench/parts/git/common/git
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
...
...
@@ -105,4 +105,8 @@ export class NoOpGitService implements IRawGitService {
getCommitTemplate
():
TPromise
<
string
>
{
return
TPromise
.
as
(
null
);
}
getCommit
(
ref
:
string
):
TPromise
<
ICommit
>
{
return
TPromise
.
as
(
null
);
}
}
\ No newline at end of file
src/vs/workbench/parts/git/node/git.lib.ts
浏览文件 @
fcdc90c7
...
...
@@ -261,6 +261,11 @@ export class Git {
}
}
export
interface
ICommit
{
hash
:
string
;
message
:
string
;
}
export
class
Repository
{
private
git
:
Git
;
...
...
@@ -723,6 +728,18 @@ export class Repository {
},
()
=>
''
);
}
getCommit
(
ref
:
string
):
TPromise
<
ICommit
>
{
return
this
.
run
([
'
show
'
,
'
-s
'
,
'
--format=%H
\n
%B
'
,
ref
]).
then
(
result
=>
{
const
match
=
/^
([
0-9a-f
]{40})\n([^]
*
)
$/m
.
exec
(
result
.
stdout
.
trim
());
if
(
!
match
)
{
return
TPromise
.
wrapError
(
'
bad commit format
'
);
}
return
{
hash
:
match
[
1
],
message
:
match
[
2
]
};
});
}
onOutput
(
listener
:
(
output
:
string
)
=>
void
):
()
=>
void
{
return
this
.
git
.
onOutput
(
listener
);
}
...
...
src/vs/workbench/parts/git/node/rawGitService.ts
浏览文件 @
fcdc90c7
...
...
@@ -9,7 +9,7 @@ import { TPromise, Promise } from 'vs/base/common/winjs.base';
import
{
detectMimesFromFile
,
detectMimesFromStream
}
from
'
vs/base/node/mime
'
;
import
{
realpath
,
exists
}
from
'
vs/base/node/pfs
'
;
import
{
Repository
,
GitError
}
from
'
vs/workbench/parts/git/node/git.lib
'
;
import
{
IRawGitService
,
RawServiceState
,
IRawStatus
,
IRef
,
GitErrorCodes
,
IPushOptions
}
from
'
vs/workbench/parts/git/common/git
'
;
import
{
IRawGitService
,
RawServiceState
,
IRawStatus
,
IRef
,
GitErrorCodes
,
IPushOptions
,
ICommit
}
from
'
vs/workbench/parts/git/common/git
'
;
import
Event
,
{
Emitter
,
fromPromise
}
from
'
vs/base/common/event
'
;
export
class
RawGitService
implements
IRawGitService
{
...
...
@@ -199,6 +199,10 @@ export class RawGitService implements IRawGitService {
getCommitTemplate
():
TPromise
<
string
>
{
return
this
.
repo
.
getCommitTemplate
();
}
getCommit
(
ref
:
string
):
TPromise
<
ICommit
>
{
return
this
.
repo
.
getCommit
(
ref
);
}
}
export
class
DelayedRawGitService
implements
IRawGitService
{
...
...
@@ -225,4 +229,5 @@ export class DelayedRawGitService implements IRawGitService {
detectMimetypes
(
path
:
string
,
treeish
?:
string
):
TPromise
<
string
[]
>
{
return
this
.
raw
.
then
(
r
=>
r
.
detectMimetypes
(
path
,
treeish
));
}
show
(
path
:
string
,
treeish
?:
string
):
TPromise
<
string
>
{
return
this
.
raw
.
then
(
r
=>
r
.
show
(
path
,
treeish
));
}
getCommitTemplate
():
TPromise
<
string
>
{
return
this
.
raw
.
then
(
r
=>
r
.
getCommitTemplate
());
}
getCommit
(
ref
:
string
):
TPromise
<
ICommit
>
{
return
this
.
raw
.
then
(
r
=>
r
.
getCommit
(
ref
));
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录