oh-my-posh/website/docs/segments/scm/svn.mdx

92 lines
4.3 KiB
Plaintext
Raw Normal View History

2022-03-30 15:33:15 -07:00
---
id: svn
2022-06-05 07:33:13 -07:00
title: Subversion
sidebar_label: Subversion
2022-03-30 15:33:15 -07:00
---
## What
2022-06-05 07:33:13 -07:00
Display subversion information when in a subversion repository. Also works for subfolders. For maximum compatibility,
2022-03-30 15:33:15 -07:00
make sure your `svn` executable is up-to-date (when branch or status information is incorrect for example).
## Sample Configuration
import Config from "@site/src/components/Config.js";
<Config
data={{
type: "svn",
style: "powerline",
powerline_symbol: "\uE0B0",
foreground: "#193549",
background: "#ffeb3b",
properties: {
fetch_status: true,
},
}}
/>
2022-03-30 15:33:15 -07:00
## Properties
### Fetching information
2022-06-05 07:33:13 -07:00
As doing multiple [subversion][svn] calls can slow down the prompt experience, we do not fetch information by default.
2022-03-30 15:33:15 -07:00
You can set the following properties to `true` to enable fetching additional information (and populate the template).
| 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](#status) section for available overrides |
2022-03-30 15:33:15 -07:00
2024-04-08 12:39:47 -07:00
:::info
The fields `Repo`, `Branch` and `BaseRev` will still work with `fetch_status` set to `false`.
:::
2022-03-30 15:33:15 -07:00
## Template ([info][templates])
:::note default template
```template
2022-03-30 15:33:15 -07:00
\ue0a0{{.Branch}} r{{.BaseRev}} {{.Working.String}}
```
:::
### Properties
2024-04-08 12:39:47 -07:00
| 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`) |
2022-03-30 15:33:15 -07:00
### Status
2022-03-30 15:33:15 -07:00
| Name | Type | Description |
| --------------- | --------- | ---------------------------------------------- |
2022-12-25 11:21:23 -08:00
| `.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 |
Local changes use the following syntax:
| Icon | Description |
| ---- | ----------- |
| `?` | Untracked |
| `~` | Modified |
| `-` | Deleted |
| `+` | Added |
| `>` | Moved |
| `!` | Conflicted |
2022-03-30 15:33:15 -07:00
2022-06-05 07:33:13 -07:00
[svn]: https://subversion.apache.org
2024-04-08 12:39:47 -07:00
[templates]: /configuration/templates.mdx