From c328252c58d215cc116dacd36a7e53ba3fc3c1f0 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 23 Sep 2008 16:48:27 +0000 Subject: 25733: add revision number to Perforce vcs_info backend add abbreviation to list of backends --- Functions/VCS_Info/Backends/VCS_INFO_get_data_p4 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Functions/VCS_Info') diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4 b/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4 index 82ca6ef1c..749d2ef4c 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4 +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4 @@ -10,5 +10,15 @@ local -A p4info p4 info | while IFS=: read a b; do p4info[${a// /_}]="${b## #}"; done p4base=${vcs_comm[basedir]} -# We'll use the client name as the branch; close enough -VCS_INFO_formats '' "${p4info[Client_name]}" "${p4base}" +# We'll use the client name as the branch; close enough. +local p4branch change +# We'll use the latest change number to which the hierarchy from +# here down is synced as the revision. +# I suppose the following might be slow on a tortuous client view. +change="${${$(p4 changes -m 1 ...)##Change }%% *}" +zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" branchformat p4branch || +p4branch="%b:%r" +zformat -f p4branch "${p4branch}" "b:${p4info[Client_name]}" \ +"r:$change" + +VCS_INFO_formats '' "${p4branch}" "${p4base}" -- cgit v1.2.3