SVN
非官方测试版翻译
本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →
功能
当处于 SVN 仓库中时显示 Subversion 信息。该功能在子文件夹中同样有效。为获得最佳兼容性,请确保您的 svn 可执行文件为最新版本(例如当分支或状态信息显示不正确时)。
示例配置
- json
- yaml
- toml
{
"type": "svn",
"style": "powerline",
"powerline_symbol": "",
"foreground": "#193549",
"background": "#ffeb3b",
"options": {
"fetch_status": true
}
}
type: svn
style: powerline
powerline_symbol:
foreground: "#193549"
background: "#ffeb3b"
options:
fetch_status: true
type = "svn"
style = "powerline"
powerline_symbol = ""
foreground = "#193549"
background = "#ffeb3b"
[options]
fetch_status = true
选项
信息获取
由于执行多次 SVN 调用会降低提示符响应速度,我们默认不获取额外信息。
您可将以下选项设为 true 以启用额外信息获取(并填充模板)。
| Name | Type | Default | Description |
|---|---|---|---|
fetch_status | boolean | false | fetch the local changes |
native_fallback | boolean | false | when set to true and svn.exe is not available when inside a WSL2 shared Windows drive, we will fallback to the native svn executable to fetch data. Not all information can be displayed in this case |
status_formats | map[string]string | a key, value map allowing to override how individual status items are displayed. For example, "status_formats": { "Added": "Added: %d" } will display the added count as Added: 1 instead of +1. See the Status section for available overrides |
信息
即使 fetch_status 设为 false,Repo、Branch 和 BaseRev 字段仍可正常使用。
模板 (信息)
默认模板
\ue0a0{{.Branch}} r{{.BaseRev}} {{.Working.String}}
属性
| Name | Type | Description |
|---|---|---|
.Working | Status | changes in the worktree (see below) |
.Branch | string | current branch (relative URL reported by svn info) |
.BaseRev | int | the currently checked out revision number |
.Repo | string | current repository (repos root URL reported by svn info) |
状态标识
| Name | Type | Description |
|---|---|---|
.Untracked | int | number of files not under version control |
.Modified | int | number of modified files |
.Deleted | int | number of deleted files |
.Added | int | number of added files |
.Moved | int | number of changed moved files |
.Conflicted | int | number of changed tracked files with conflicts |
.Changed | boolean | if the status contains changes or not |
.HasConflicts | boolean | if the status contains conflicts or not |
.String | string | a string representation of the changes above |
本地变更使用以下语法表示:
| Icon | Description |
|---|---|
? | Untracked |
~ | Modified |
- | Deleted |
+ | Added |
> | Moved |
! | Conflicted |