From 5425a5eb56433d4332441d37eae69d159ab456c1 Mon Sep 17 00:00:00 2001 From: Brett McBride Date: Wed, 19 Mar 2014 11:18:23 +1100 Subject: [PATCH] SVN: Support for paths that are not branches or trunk Also fallback to displaying the repo's root name in the case where the repo path is none of tags/branches/trunk --- liquidprompt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/liquidprompt b/liquidprompt index 7ff2ee2..734a517 100755 --- a/liquidprompt +++ b/liquidprompt @@ -891,8 +891,12 @@ _lp_svn_branch() url="${url:${#root}}" if [[ "$url" == */trunk* ]] ; then echo -n trunk - else + elif [[ "$url" == */branches* ]] ; then _lp_escape "$(expr "$url" : '.*/branches/\([^/]*\)' || expr "$url" : '/\([^/]*\)' || basename "$root")" + elif [[ "$url" == */tags* ]] ; then + _lp_escape "$(expr "$url" : '.*/tags/\([^/]*\)' || expr "$url" : '/\([^/]*\)' || basename "$root")" + else + _lp_escape "$(basename "$root")" fi }