From c5b5c3ca83717f31087dd8c0de9c467ab0663c30 Mon Sep 17 00:00:00 2001 From: Christian Ferbar Date: Tue, 27 Sep 2016 12:26:51 +0200 Subject: [PATCH] add some documentation for the svn plugin --- Plugin:svn.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Plugin:svn.md diff --git a/Plugin:svn.md b/Plugin:svn.md new file mode 100644 index 0000000..36fc959 --- /dev/null +++ b/Plugin:svn.md @@ -0,0 +1,45 @@ + +###Agnoster theme git-like prompt + +Enable the svn plugin and add the followind lines to your ```~/.zshrc``` + +```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 +} +``` + +```shell +build_prompt() { + RETVAL=$? + prompt_status + prompt_context + prompt_dir + prompt_git + prompt_svn + prompt_end +} +``` + +## Functions + + +| Command | Description | +|:-----------------------|:----------------------------------------| +|svn_prompt_info | prompt for some themes | +|in_svn | within svn directory | +|svn_get_repo_name | | +|svn_get_branch_name | branch name (bug: returns the first path element if branches not used) | +|svn_dirty | changes in this subversion repo |