Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
91ec2ba0
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
91ec2ba0
编写于
12月 03, 2015
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
git pull with rebase
fixes #907 related to #150
上级
254ddfd8
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
42 addition
and
15 deletion
+42
-15
src/vs/workbench/parts/git/browser/gitActions.ts
src/vs/workbench/parts/git/browser/gitActions.ts
+26
-3
src/vs/workbench/parts/git/browser/gitServices.ts
src/vs/workbench/parts/git/browser/gitServices.ts
+2
-2
src/vs/workbench/parts/git/browser/views/changes/changesView.ts
.../workbench/parts/git/browser/views/changes/changesView.ts
+2
-1
src/vs/workbench/parts/git/common/git.ts
src/vs/workbench/parts/git/common/git.ts
+2
-2
src/vs/workbench/parts/git/common/noopGitService.ts
src/vs/workbench/parts/git/common/noopGitService.ts
+1
-1
src/vs/workbench/parts/git/node/git.lib.ts
src/vs/workbench/parts/git/node/git.lib.ts
+5
-2
src/vs/workbench/parts/git/node/rawGitService.ts
src/vs/workbench/parts/git/node/rawGitService.ts
+4
-4
未找到文件。
src/vs/workbench/parts/git/browser/gitActions.ts
浏览文件 @
91ec2ba0
...
...
@@ -819,9 +819,14 @@ export class SmartCommitAction extends BaseCommitAction {
export
class
PullAction
extends
GitAction
{
static
ID
=
'
workbench.action.pull
'
;
static
LABEL
=
nls
.
localize
(
'
pull
'
,
"
Pull
"
);
constructor
(@
IGitService
gitService
:
IGitService
)
{
super
(
PullAction
.
ID
,
nls
.
localize
(
'
pull
'
,
"
Pull
"
),
'
git-action pull
'
,
gitService
);
constructor
(
id
=
PullAction
.
ID
,
label
=
PullAction
.
LABEL
,
@
IGitService
gitService
:
IGitService
)
{
super
(
id
,
label
,
'
git-action pull
'
,
gitService
);
}
protected
isEnabled
():
boolean
{
...
...
@@ -844,7 +849,11 @@ export class PullAction extends GitAction {
}
public
run
(
context
?:
any
):
Promise
{
return
this
.
gitService
.
pull
().
then
(
null
,
(
err
)
=>
{
return
this
.
pull
();
}
protected
pull
(
rebase
=
false
):
Promise
{
return
this
.
gitService
.
pull
(
rebase
).
then
(
null
,
(
err
)
=>
{
if
(
err
.
gitErrorCode
===
GitErrorCodes
.
DirtyWorkTree
)
{
return
Promise
.
wrapError
(
errors
.
create
(
nls
.
localize
(
'
dirtyTreePull
'
,
"
Can't pull. Please commit or stage your work first.
"
),
{
severity
:
Severity
.
Warning
}));
}
else
if
(
err
.
gitErrorCode
===
GitErrorCodes
.
AuthenticationFailed
)
{
...
...
@@ -856,6 +865,20 @@ export class PullAction extends GitAction {
}
}
export
class
PullWithRebaseAction
extends
PullAction
{
static
ID
=
'
workbench.action.pull.rebase
'
;
static
LABEL
=
nls
.
localize
(
'
pullWithRebase
'
,
"
Pull (Rebase)
"
);
constructor
(@
IGitService
gitService
:
IGitService
)
{
super
(
PullWithRebaseAction
.
ID
,
PullWithRebaseAction
.
LABEL
,
gitService
);
}
public
run
(
context
?:
any
):
Promise
{
return
this
.
pull
(
true
);
}
}
export
class
PushAction
extends
GitAction
{
static
ID
=
'
workbench.action.push
'
;
...
...
src/vs/workbench/parts/git/browser/gitServices.ts
浏览文件 @
91ec2ba0
...
...
@@ -553,8 +553,8 @@ export class GitService extends ee.EventEmitter
return
this
.
run
(
git
.
ServiceOperations
.
BACKGROUND_FETCH
,
()
=>
this
.
raw
.
fetch
());
}
public
pull
():
winjs
.
Promise
{
return
this
.
run
(
git
.
ServiceOperations
.
PULL
,
()
=>
this
.
raw
.
pull
());
public
pull
(
rebase
?:
boolean
):
winjs
.
Promise
{
return
this
.
run
(
git
.
ServiceOperations
.
PULL
,
()
=>
this
.
raw
.
pull
(
rebase
));
}
public
push
():
winjs
.
Promise
{
...
...
src/vs/workbench/parts/git/browser/views/changes/changesView.ts
浏览文件 @
91ec2ba0
...
...
@@ -248,7 +248,8 @@ export class ChangesView extends EventEmitter.EventEmitter implements GitView.IV
if
(
!
this
.
secondaryActions
)
{
this
.
secondaryActions
=
[
this
.
instantiationService
.
createInstance
(
GitActions
.
SyncAction
,
GitActions
.
SyncAction
.
ID
,
GitActions
.
SyncAction
.
LABEL
),
this
.
instantiationService
.
createInstance
(
GitActions
.
PullAction
),
this
.
instantiationService
.
createInstance
(
GitActions
.
PullAction
,
GitActions
.
PullAction
.
ID
,
GitActions
.
PullAction
.
LABEL
),
this
.
instantiationService
.
createInstance
(
GitActions
.
PullWithRebaseAction
),
this
.
instantiationService
.
createInstance
(
GitActions
.
PushAction
),
new
ActionBar
.
Separator
(),
this
.
instantiationService
.
createInstance
(
GitActions
.
CommitAction
,
this
),
...
...
src/vs/workbench/parts/git/common/git.ts
浏览文件 @
91ec2ba0
...
...
@@ -259,7 +259,7 @@ export interface IRawGitService {
reset
(
treeish
:
string
,
hard
?:
boolean
):
WinJS
.
TPromise
<
IRawStatus
>
;
revertFiles
(
treeish
:
string
,
filePaths
?:
string
[]):
WinJS
.
TPromise
<
IRawStatus
>
;
fetch
():
WinJS
.
TPromise
<
IRawStatus
>
;
pull
():
WinJS
.
TPromise
<
IRawStatus
>
;
pull
(
rebase
?:
boolean
):
WinJS
.
TPromise
<
IRawStatus
>
;
push
():
WinJS
.
TPromise
<
IRawStatus
>
;
sync
():
WinJS
.
TPromise
<
IRawStatus
>
;
commit
(
message
:
string
,
amend
?:
boolean
,
stage
?:
boolean
):
WinJS
.
TPromise
<
IRawStatus
>
;
...
...
@@ -285,7 +285,7 @@ export interface IGitService extends EventEmitter.IEventEmitter {
reset
(
treeish
:
string
,
hard
?:
boolean
):
WinJS
.
TPromise
<
IModel
>
;
revertFiles
(
treeish
:
string
,
files
?:
IFileStatus
[]):
WinJS
.
TPromise
<
IModel
>
;
fetch
():
WinJS
.
TPromise
<
IModel
>
;
pull
():
WinJS
.
TPromise
<
IModel
>
;
pull
(
rebase
?:
boolean
):
WinJS
.
TPromise
<
IModel
>
;
push
():
WinJS
.
TPromise
<
IModel
>
;
sync
():
WinJS
.
TPromise
<
IModel
>
;
commit
(
message
:
string
,
amend
?:
boolean
,
stage
?:
boolean
):
WinJS
.
TPromise
<
IModel
>
;
...
...
src/vs/workbench/parts/git/common/noopGitService.ts
浏览文件 @
91ec2ba0
...
...
@@ -65,7 +65,7 @@ export class NoOpGitService implements git.IRawGitService {
return
winjs
.
Promise
.
as
(
NoOpGitService
.
STATUS
);
}
public
pull
():
winjs
.
TPromise
<
git
.
IRawStatus
>
{
public
pull
(
rebase
?:
boolean
):
winjs
.
TPromise
<
git
.
IRawStatus
>
{
return
winjs
.
Promise
.
as
(
NoOpGitService
.
STATUS
);
}
...
...
src/vs/workbench/parts/git/node/git.lib.ts
浏览文件 @
91ec2ba0
...
...
@@ -506,8 +506,11 @@ export class Repository {
});
}
public
pull
():
Promise
{
return
this
.
run
([
'
pull
'
]).
then
(
null
,
(
err
:
GitError
)
=>
{
public
pull
(
rebase
?:
boolean
):
Promise
{
const
args
=
[
'
pull
'
];
rebase
&&
args
.
push
(
'
-r
'
);
return
this
.
run
(
args
).
then
(
null
,
(
err
:
GitError
)
=>
{
if
(
/^CONFLICT
\([^
)
]
+
\)
:
\b
/m
.
test
(
err
.
stdout
))
{
err
.
gitErrorCode
=
GitErrorCodes
.
Conflict
;
}
else
if
(
/Please tell me who you are
\.
/
.
test
(
err
.
stderr
))
{
...
...
src/vs/workbench/parts/git/node/rawGitService.ts
浏览文件 @
91ec2ba0
...
...
@@ -116,8 +116,8 @@ export class RawGitService implements IRawGitService {
}).
then
(()
=>
this
.
status
());
}
public
pull
():
TPromise
<
IRawStatus
>
{
return
this
.
repo
.
pull
().
then
(()
=>
this
.
status
());
public
pull
(
rebase
?:
boolean
):
TPromise
<
IRawStatus
>
{
return
this
.
repo
.
pull
(
rebase
).
then
(()
=>
this
.
status
());
}
public
push
():
TPromise
<
IRawStatus
>
{
...
...
@@ -235,8 +235,8 @@ export class DelayedRawGitService implements IRawGitService {
return
this
.
raw
.
then
(
raw
=>
raw
.
fetch
());
}
public
pull
():
TPromise
<
IRawStatus
>
{
return
this
.
raw
.
then
(
raw
=>
raw
.
pull
());
public
pull
(
rebase
?:
boolean
):
TPromise
<
IRawStatus
>
{
return
this
.
raw
.
then
(
raw
=>
raw
.
pull
(
rebase
));
}
public
push
():
TPromise
<
IRawStatus
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录