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
This commit is contained in:
Brett McBride 2014-03-19 11:18:23 +11:00 committed by Olivier Mengué
parent e9279856c4
commit 5425a5eb56

View File

@ -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
}