mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-29 17:31:02 +01:00
25733: add revision number to Perforce vcs_info backend
add abbreviation to list of backends
This commit is contained in:
parent
f49d738db3
commit
c328252c58
3 changed files with 27 additions and 12 deletions
|
|
@ -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}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue