Mired in code
Check-in [3a7ed63216]
Not logged in
Public Repositories
mwm's Repositories

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor fixes from code review for blogging
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3a7ed63216ffc9d4c99c674033620522677e6501
User & Date: mwm@mired.org 2011-02-24 08:16:58.000
Context
2011-02-24
08:17
Add code from my .zshrc so readers can recreate the example. check-in: 72974d03d3 user: mwm@mired.org tags: trunk
08:16
Minor fixes from code review for blogging check-in: 3a7ed63216 user: mwm@mired.org tags: trunk
05:27
Add the vcs_info code check-in: 56c23e9507 user: mwm@mired.org tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to vcs_info/VCS_INFO_get_data_fossil.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
## vim:ft=zsh
## perforce support by: Phil Pennock
## Distributed under the same BSD-ish license as zsh itself.

# XXX: This soooo needs to be cached
setopt localoptions extendedglob
local fsbase a b
local change changed
local action merging
local -A fsinfo
local -xA hook_com

${vcs_comm[cmd]} status | while IFS=: read a b; do fsinfo[${a//-/_}]="${b## #}"; done
fsbase=${vcs_comm[basedir]}
fshash=${fsinfo[checkout]%% *}
changed=${(Mk)fsinfo:#(ADDED|EDITED|DELETED|UPDATED)*}
merging=${(Mk)fsinfo:#*_BY_MERGE*}
if [ -n "$merging" ]; then
   action="merging"
fi







|






<







1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
## vim:ft=zsh
## perforce support by: Phil Pennock
## Distributed under the same BSD-ish license as zsh itself.

# XXX: This soooo needs to be cached
setopt localoptions extendedglob
local a b
local change changed
local action merging
local -A fsinfo
local -xA hook_com

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

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

30
31
32
33
34
35
36

37

38
39
40
41
42

43

44
45
    fsrev=${hook_com[rev-replace]}
fi

hook_com=()

# Now build the branch display
zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" branchformat fsbranch || fsbranch="%b:%r"

hook_com=( branch "${fsinfo[tags]%%, *}" revision "${fsrev}" )

if VCS_INFO_hook 'set-branch-format' "${fsbranch}"; then
    zformat -f fsbranch "${fsbranch}" "b:${hook_com[branch]}" "r:${hook_com[revision]}"
else
    fsbranch=${hook_com[branch-replace]}
fi

hook_com=()

VCS_INFO_formats "$action" "${fsbranch}" "${fsinfo[local_root]}" '' "$changed" "${fsrev}" "${fsinfo[repository]}"
return 0







>

>





>

>


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
    fsrev=${hook_com[rev-replace]}
fi

hook_com=()

# Now build the branch display
zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" branchformat fsbranch || fsbranch="%b:%r"

hook_com=( branch "${fsinfo[tags]%%, *}" revision "${fsrev}" )

if VCS_INFO_hook 'set-branch-format' "${fsbranch}"; then
    zformat -f fsbranch "${fsbranch}" "b:${hook_com[branch]}" "r:${hook_com[revision]}"
else
    fsbranch=${hook_com[branch-replace]}
fi

hook_com=()

VCS_INFO_formats "$action" "${fsbranch}" "${fsinfo[local_root]}" '' "$changed" "${fsrev}" "${fsinfo[repository]}"
return 0