File: VCS_INFO_get_data_fossil

package info (click to toggle)
zsh 5.9-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,856 kB
  • sloc: ansic: 108,138; sh: 6,976; makefile: 722; perl: 687; awk: 291; sed: 16
file content (25 lines) | stat: -rw-r--r-- 682 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## vim:ft=zsh
## fossil support by: Mike Meyer (mwm@mired.org)
## Distributed under the same BSD-ish license as zsh itself.

setopt localoptions extendedglob
local a b
local -A fsinfo
local fshash fsbranch changed merging action

${vcs_comm[cmd]} status |
   while IFS=: read a b; do
      fsinfo[${a//-/_}]="${b## #}"
   done

fshash=${fsinfo[checkout]%% *}
fsbranch=${fsinfo[tags]%%, *}
changed=${(Mk)fsinfo:#(ADDED|EDITED|DELETED|UPDATED)*}
merging=${(Mk)fsinfo:#*_BY_MERGE*}
if [ -n "$merging" ]; then
   action="merging"
fi

rrn=${fsinfo[local_root]:t}
VCS_INFO_formats "$action" "${fsbranch}" "${fsinfo[local_root]}" '' "$changed" "${fshash}" "${fsinfo[repository]}"
return 0