Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
43dd9b76
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,发现更多精彩内容 >>
提交
43dd9b76
编写于
1月 17, 2017
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
git: nls
related to #18615
上级
fab6f887
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
87 addition
and
48 deletion
+87
-48
extensions/git/package.json
extensions/git/package.json
+25
-25
extensions/git/package.nls.json
extensions/git/package.nls.json
+27
-0
extensions/git/src/commands.ts
extensions/git/src/commands.ts
+20
-13
extensions/git/src/git.ts
extensions/git/src/git.ts
+1
-1
extensions/git/src/main.ts
extensions/git/src/main.ts
+3
-3
extensions/git/src/model.ts
extensions/git/src/model.ts
+5
-3
extensions/git/src/statusbar.ts
extensions/git/src/statusbar.ts
+6
-3
未找到文件。
extensions/git/package.json
浏览文件 @
43dd9b76
...
...
@@ -23,7 +23,7 @@
"commands"
:
[
{
"command"
:
"git.refresh"
,
"title"
:
"
Refresh
"
,
"title"
:
"
%command.refresh%
"
,
"category"
:
"Git"
,
"icon"
:
{
"light"
:
"resources/icons/light/refresh.svg"
,
...
...
@@ -32,17 +32,17 @@
},
{
"command"
:
"git.openChange"
,
"title"
:
"
Open Change
"
,
"title"
:
"
%command.openChange%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.openFile"
,
"title"
:
"
Open File
"
,
"title"
:
"
%command.openFile%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.stage"
,
"title"
:
"
Stage
"
,
"title"
:
"
%command.stage%
"
,
"category"
:
"Git"
,
"icon"
:
{
"light"
:
"resources/icons/light/stage.svg"
,
...
...
@@ -51,7 +51,7 @@
},
{
"command"
:
"git.stageAll"
,
"title"
:
"
Stage All
"
,
"title"
:
"
%command.stageAll%
"
,
"category"
:
"Git"
,
"icon"
:
{
"light"
:
"resources/icons/light/stage.svg"
,
...
...
@@ -60,7 +60,7 @@
},
{
"command"
:
"git.unstage"
,
"title"
:
"
Unstage
"
,
"title"
:
"
%command.unstage%
"
,
"category"
:
"Git"
,
"icon"
:
{
"light"
:
"resources/icons/light/unstage.svg"
,
...
...
@@ -69,7 +69,7 @@
},
{
"command"
:
"git.unstageAll"
,
"title"
:
"
Unstage All
"
,
"title"
:
"
%command.unstageAll%
"
,
"category"
:
"Git"
,
"icon"
:
{
"light"
:
"resources/icons/light/unstage.svg"
,
...
...
@@ -78,7 +78,7 @@
},
{
"command"
:
"git.clean"
,
"title"
:
"
Clean
"
,
"title"
:
"
%command.clean%
"
,
"category"
:
"Git"
,
"icon"
:
{
"light"
:
"resources/icons/light/clean.svg"
,
...
...
@@ -87,7 +87,7 @@
},
{
"command"
:
"git.cleanAll"
,
"title"
:
"
Clean All
"
,
"title"
:
"
%command.cleanAll%
"
,
"category"
:
"Git"
,
"icon"
:
{
"light"
:
"resources/icons/light/clean.svg"
,
...
...
@@ -96,72 +96,72 @@
},
{
"command"
:
"git.commitStaged"
,
"title"
:
"
Commit Staged
"
,
"title"
:
"
%command.commitStaged%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.commitStagedSigned"
,
"title"
:
"
Commit Staged (Signed Off)
"
,
"title"
:
"
%command.commitStagedSigned%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.commitAll"
,
"title"
:
"
Commit All
"
,
"title"
:
"
%command.commitAll%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.commitAllSigned"
,
"title"
:
"
Commit All (Signed Off)
"
,
"title"
:
"
%command.commitAllSigned%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.undoCommit"
,
"title"
:
"
Undo Last Commit
"
,
"title"
:
"
%command.undoCommit%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.checkout"
,
"title"
:
"
Checkout to...
"
,
"title"
:
"
%command.checkout%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.branch"
,
"title"
:
"
Create Branch...
"
,
"title"
:
"
%command.branch%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.pull"
,
"title"
:
"
Pull
"
,
"title"
:
"
%command.pull%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.pullRebase"
,
"title"
:
"
Pull (Rebase)
"
,
"title"
:
"
%command.pullRebase%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.push"
,
"title"
:
"
Push
"
,
"title"
:
"
%command.push%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.pushTo"
,
"title"
:
"
Push to...
"
,
"title"
:
"
%command.pushTo%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.sync"
,
"title"
:
"
Sync
"
,
"title"
:
"
%command.sync%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.publish"
,
"title"
:
"
Publish
"
,
"title"
:
"
%command.publish%
"
,
"category"
:
"Git"
},
{
"command"
:
"git.showOutput"
,
"title"
:
"
Show Git Output
"
,
"title"
:
"
%command.showOutput%
"
,
"category"
:
"Git"
}
],
...
...
@@ -352,7 +352,7 @@
{
"id"
:
"git-commit"
,
"aliases"
:
[
"
Git Commit Message
"
,
"
%language-alias.git-commit%
"
,
"git-commit"
],
"filenames"
:
[
...
...
@@ -364,7 +364,7 @@
{
"id"
:
"git-rebase"
,
"aliases"
:
[
"
Git Rebase Message
"
,
"
%language-alias.git-rebase%
"
,
"git-rebase"
],
"filenames"
:
[
...
...
extensions/git/package.nls.json
0 → 100644
浏览文件 @
43dd9b76
{
"command.refresh"
:
"Refresh"
,
"command.openChange"
:
"Open Change"
,
"command.openFile"
:
"Open File"
,
"command.stage"
:
"Stage"
,
"command.stageAll"
:
"Stage All"
,
"command.unstage"
:
"Unstage"
,
"command.unstageAll"
:
"Unstage All"
,
"command.clean"
:
"Clean"
,
"command.cleanAll"
:
"Clean All"
,
"command.commitStaged"
:
"Commit Staged"
,
"command.commitStagedSigned"
:
"Commit Staged (Signed Off)"
,
"command.commitAll"
:
"Commit All"
,
"command.commitAllSigned"
:
"Commit All (Signed Off)"
,
"command.undoCommit"
:
"Undo Last Commit"
,
"command.checkout"
:
"Checkout to..."
,
"command.branch"
:
"Create Branch..."
,
"command.pull"
:
"Pull"
,
"command.pullRebase"
:
"Pull (Rebase)"
,
"command.push"
:
"Push"
,
"command.pushTo"
:
"Push to..."
,
"command.sync"
:
"Sync"
,
"command.publish"
:
"Publish"
,
"command.showOutput"
:
"Show Git Output"
,
"language-alias.git-commit"
:
"Git Commit Message"
,
"language-alias.git-rebase"
:
"Git Rebase Message"
}
\ No newline at end of file
extensions/git/src/commands.ts
浏览文件 @
43dd9b76
...
...
@@ -9,6 +9,9 @@ import { Uri, commands, scm, Disposable, SCMResourceGroup, SCMResource, window,
import
{
IRef
,
RefType
}
from
'
./git
'
;
import
{
Model
,
Resource
,
Status
}
from
'
./model
'
;
import
*
as
path
from
'
path
'
;
import
*
as
nls
from
'
vscode-nls
'
;
const
localize
=
nls
.
loadMessageBundle
();
function
resolveGitURI
(
uri
:
Uri
):
SCMResource
|
SCMResourceGroup
|
undefined
{
if
(
uri
.
authority
!==
'
git
'
)
{
...
...
@@ -50,12 +53,16 @@ class CheckoutItem implements QuickPickItem {
class
CheckoutTagItem
extends
CheckoutItem
{
get
description
():
string
{
return
`Tag at
${
this
.
shortCommit
}
`
;
}
get
description
():
string
{
return
localize
(
'
tag at
'
,
"
Tag at {0}
"
,
this
.
shortCommit
);
}
}
class
CheckoutRemoteHeadItem
extends
CheckoutItem
{
get
description
():
string
{
return
`Remote branch at
${
this
.
shortCommit
}
`
;
}
get
description
():
string
{
return
localize
(
'
remote branch at
'
,
"
Remote branch at {0}
"
,
this
.
shortCommit
);
}
protected
get
treeish
():
string
|
undefined
{
if
(
!
this
.
ref
.
name
)
{
...
...
@@ -93,7 +100,7 @@ export class CommandCenter {
switch
(
err
.
gitErrorCode
)
{
case
'
DirtyWorkTree
'
:
message
=
'
Please clean your repository working tree before checkout.
'
;
message
=
localize
(
'
clean repo
'
,
"
Please clean your repository working tree before checkout.
"
)
;
break
;
default
:
message
=
(
err
.
stderr
||
err
.
message
).
replace
(
/^error: /
,
''
);
...
...
@@ -106,7 +113,7 @@ export class CommandCenter {
}
const
outputChannel
=
this
.
outputChannel
as
OutputChannel
;
const
openOutputChannelChoice
=
'
Open Git Log
'
;
const
openOutputChannelChoice
=
localize
(
'
open git log
'
,
"
Open Git Log
"
)
;
const
choice
=
await
window
.
showErrorMessage
(
message
,
openOutputChannelChoice
);
if
(
choice
===
openOutputChannelChoice
)
{
...
...
@@ -270,9 +277,9 @@ export class CommandCenter {
}
const
basename
=
path
.
basename
(
resource
.
uri
.
fsPath
);
const
message
=
`Are you sure you want to clean changes in
${
basename
}
?`
;
const
yes
=
'
Yes
'
;
const
no
=
'
No, keep them
'
;
const
message
=
localize
(
'
confirm clean
'
,
"
Are you sure you want to clean changes in {0}?
"
,
basename
)
;
const
yes
=
localize
(
'
yes
'
,
"
Yes
"
)
;
const
no
=
localize
(
'
no, keep them
'
,
"
No, keep them
"
)
;
const
pick
=
await
window
.
showQuickPick
([
yes
,
no
],
{
placeHolder
:
message
});
if
(
pick
!==
yes
)
{
...
...
@@ -285,9 +292,9 @@ export class CommandCenter {
@
CommandCenter
.
Command
(
'
git.cleanAll
'
)
@
CommandCenter
.
CatchErrors
async
cleanAll
():
Promise
<
void
>
{
const
message
=
`Are you sure you want to clean all changes?`
;
const
yes
=
'
Yes
'
;
const
no
=
'
No, keep them
'
;
const
message
=
localize
(
'
confirm clean all
'
,
"
Are you sure you want to clean all changes?
"
)
;
const
yes
=
localize
(
'
yes
'
,
"
Yes
"
)
;
const
no
=
localize
(
'
no, keep them
'
,
"
No, keep them
"
)
;
const
pick
=
await
window
.
showQuickPick
([
yes
,
no
],
{
placeHolder
:
message
});
if
(
pick
!==
yes
)
{
...
...
@@ -359,8 +366,8 @@ export class CommandCenter {
@
CommandCenter
.
CatchErrors
async
branch
():
Promise
<
void
>
{
const
result
=
await
window
.
showInputBox
({
placeHolder
:
'
Branch name
'
,
prompt
:
'
Please provide a branch name
'
placeHolder
:
localize
(
'
branch name
'
,
"
Branch name
"
)
,
prompt
:
localize
(
'
provide branch name
'
,
"
Please provide a branch name
"
)
});
if
(
!
result
)
{
...
...
@@ -406,7 +413,7 @@ export class CommandCenter {
async
publish
():
Promise
<
void
>
{
const
branchName
=
this
.
model
.
HEAD
&&
this
.
model
.
HEAD
.
name
||
''
;
const
picks
=
this
.
model
.
remotes
.
map
(
r
=>
r
.
name
);
const
placeHolder
=
`Pick a remote to publish the branch '
${
branchName
}
' to:`
;
const
placeHolder
=
localize
(
'
pick remote
'
,
"
Pick a remote to publish the branch '{0}' to:
"
,
branchName
)
;
const
choice
=
await
window
.
showQuickPick
(
picks
,
{
placeHolder
});
if
(
!
choice
)
{
...
...
extensions/git/src/git.ts
浏览文件 @
43dd9b76
...
...
@@ -15,7 +15,7 @@ import * as _ from 'lodash';
import
{
EventEmitter
,
Event
}
from
'
vscode
'
;
import
*
as
nls
from
'
vscode-nls
'
;
const
localize
=
nls
.
loadMessageBundle
(
__filename
);
const
localize
=
nls
.
loadMessageBundle
();
const
readdir
=
denodeify
(
fs
.
readdir
);
const
readfile
=
denodeify
<
string
,
string
,
string
>
(
fs
.
readFile
);
...
...
extensions/git/src/main.ts
浏览文件 @
43dd9b76
...
...
@@ -16,7 +16,7 @@ import { GitContentProvider } from './contentProvider';
import
{
AutoFetcher
}
from
'
./autofetch
'
;
import
*
as
nls
from
'
vscode-nls
'
;
nls
.
config
();
const
localize
=
nls
.
config
()
();
async
function
init
(
disposables
:
Disposable
[]):
Promise
<
void
>
{
const
rootPath
=
workspace
.
rootPath
;
...
...
@@ -36,8 +36,8 @@ async function init(disposables: Disposable[]): Promise<void> {
const
repositoryRoot
=
await
repository
.
getRoot
();
const
model
=
new
Model
(
repositoryRoot
,
repository
,
onWorkspaceChange
);
const
outputChannel
=
window
.
createOutputChannel
(
'
g
it
'
);
outputChannel
.
appendLine
(
`Using git
${
info
.
version
}
from
${
info
.
path
}
`
);
const
outputChannel
=
window
.
createOutputChannel
(
'
G
it
'
);
outputChannel
.
appendLine
(
localize
(
'
using git
'
,
"
Using git {0} from {1}
"
,
info
.
version
,
info
.
path
)
);
git
.
onOutput
(
str
=>
outputChannel
.
append
(
str
),
null
,
disposables
);
const
commandCenter
=
new
CommandCenter
(
model
,
outputChannel
);
...
...
extensions/git/src/model.ts
浏览文件 @
43dd9b76
...
...
@@ -11,7 +11,9 @@ import { throttle, anyEvent, eventToPromise, filterEvent, mapEvent } from './uti
import
{
watch
}
from
'
./watch
'
;
import
{
decorate
,
memoize
,
debounce
}
from
'
core-decorators
'
;
import
*
as
path
from
'
path
'
;
import
*
as
nls
from
'
vscode-nls
'
;
const
localize
=
nls
.
loadMessageBundle
();
const
iconsRootPath
=
path
.
join
(
path
.
dirname
(
__dirname
),
'
resources
'
,
'
icons
'
);
function
getIconUri
(
iconName
:
string
,
theme
:
string
):
Uri
{
...
...
@@ -129,7 +131,7 @@ export class MergeGroup extends ResourceGroup {
static
readonly
ID
=
'
merge
'
;
constructor
(
resources
:
Resource
[])
{
super
(
MergeGroup
.
ID
,
'
Merge Changes
'
,
resources
);
super
(
MergeGroup
.
ID
,
localize
(
'
merge changes
'
,
"
Merge Changes
"
)
,
resources
);
}
}
...
...
@@ -138,7 +140,7 @@ export class IndexGroup extends ResourceGroup {
static
readonly
ID
=
'
index
'
;
constructor
(
resources
:
Resource
[])
{
super
(
IndexGroup
.
ID
,
'
Staged Changes
'
,
resources
);
super
(
IndexGroup
.
ID
,
localize
(
'
staged changes
'
,
"
Staged Changes
"
)
,
resources
);
}
}
...
...
@@ -147,7 +149,7 @@ export class WorkingTreeGroup extends ResourceGroup {
static
readonly
ID
=
'
workingTree
'
;
constructor
(
resources
:
Resource
[])
{
super
(
WorkingTreeGroup
.
ID
,
'
Changes
'
,
resources
);
super
(
WorkingTreeGroup
.
ID
,
localize
(
'
changes
'
,
"
Changes
"
)
,
resources
);
}
}
...
...
extensions/git/src/statusbar.ts
浏览文件 @
43dd9b76
...
...
@@ -8,6 +8,9 @@
import
{
window
,
Disposable
,
StatusBarItem
,
StatusBarAlignment
}
from
'
vscode
'
;
import
{
RefType
,
IBranch
}
from
'
./git
'
;
import
{
Model
,
Operation
}
from
'
./model
'
;
import
*
as
nls
from
'
vscode-nls
'
;
const
localize
=
nls
.
loadMessageBundle
();
export
class
CheckoutStatusBar
{
...
...
@@ -116,11 +119,11 @@ export class SyncStatusBar {
text
+=
`
${
HEAD
.
behind
}
↓
${
HEAD
.
ahead
}
↑`
;
}
command
=
'
git.sync
'
;
tooltip
=
'
Synchronize changes
'
;
tooltip
=
localize
(
'
sync changes
'
,
"
Synchronize changes
"
)
;
}
else
{
icon
=
'
$(cloud-upload)
'
;
command
=
'
git.publish
'
;
tooltip
=
'
Publish changes
'
;
tooltip
=
localize
(
'
publish changes
'
,
"
Publish changes
"
)
;
}
}
else
{
command
=
''
;
...
...
@@ -130,7 +133,7 @@ export class SyncStatusBar {
if
(
this
.
state
.
isSyncRunning
)
{
text
=
''
;
command
=
''
;
tooltip
=
'
Synchronizing changes...
'
;
tooltip
=
localize
(
'
syncing changes
'
,
"
Synchronizing changes...
"
)
;
}
this
.
raw
.
text
=
[
icon
,
text
].
join
(
'
'
).
trim
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录