summaryrefslogtreecommitdiff
path: root/plugins/svn/README.md
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2016-09-29 14:04:22 +0200
committerMarc Cornellà <marc.cornella@live.com>2016-09-29 14:04:22 +0200
commit1ad2556ce37d3900f38f5905ded60168dbd36ab7 (patch)
tree9bff6c93b83a1d06baf5cb7994ea2105e7b20950 /plugins/svn/README.md
parentac8915d43f0e8de9294c8552dc338ecc9993acd2 (diff)
parente6df0e036e39bcc2c20d7feaef1749d3c4f2768f (diff)
downloadzsh-1ad2556ce37d3900f38f5905ded60168dbd36ab7.tar.gz
zsh-1ad2556ce37d3900f38f5905ded60168dbd36ab7.tar.bz2
zsh-1ad2556ce37d3900f38f5905ded60168dbd36ab7.zip
Merge branch 'refactor-svn-plugin'
Closes #5462
Diffstat (limited to 'plugins/svn/README.md')
-rw-r--r--plugins/svn/README.md67
1 files changed, 67 insertions, 0 deletions
diff --git a/plugins/svn/README.md b/plugins/svn/README.md
new file mode 100644
index 000000000..1f7b70c86
--- /dev/null
+++ b/plugins/svn/README.md
@@ -0,0 +1,67 @@
+# `svn` plugin
+
+This plugin adds some utility functions to display additional information regarding your current
+svn repository. See http://subversion.apache.org/ for the full svn documentation.
+
+To use it, add `svn` to your plugins array:
+
+```zsh
+plugins=(... svn)
+```
+
+## Functions
+
+| Command | Description |
+|:----------------------|:--------------------------------------------|
+| `svn_prompt_info` | Shows svn prompt in themes |
+| `in_svn` | Checks if we're in an svn repository |
+| `svn_get_repo_name` | Get repository name |
+| `svn_get_branch_name` | Get branch name (see [caveats](#caveats)) |
+| `svn_get_rev_nr` | Get revision number |
+| `svn_dirty` | Checks if there are changes in the svn repo |
+
+## Caveats
+
+The plugin expects the first directory to be the current branch / tag / trunk. So it returns
+the first path element if you don't use branches.
+
+## Usage on themes
+
+To use this in the `agnoster` theme follow these instructions:
+
+1. Enable the svn plugin
+
+2. Add the following lines to your `zshrc` file:
+
+ ```shell
+ prompt_svn() {
+ local rev branch
+ if in_svn; then
+ rev=$(svn_get_rev_nr)
+ branch=$(svn_get_branch_name)
+ if [[ $(svn_dirty_choose_pwd 1 0) -eq 1 ]]; then
+ prompt_segment yellow black
+ echo -n "$rev@$branch"
+ echo -n "±"
+ else
+ prompt_segment green black
+ echo -n "$rev@$branch"
+ fi
+ fi
+ }
+ ```
+
+3. Override the agnoster `build_prompt()` function:
+
+ ```zsh
+ build_prompt() {
+ RETVAL=$?
+ prompt_status
+ prompt_context
+ prompt_dir
+ prompt_git
+ prompt_svn
+ prompt_end
+ }
+ ```
+