Mired in code
Check-in [56c23e9507]
Not logged in
Public Repositories
mwm's Repositories

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

Overview
Comment:Add the vcs_info code
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:56c23e9507d2ea36052754985c70489d3d9e5111
User & Date: mwm@mired.org 2011-02-24 05:27:38
Context
2011-02-24
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
2010-11-22
23:31
Add the initial version of the x10 controller application. check-in: a8c08a5679 user: mwm@mired.org tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added vcs_info/README.







>
>
>
1
2
3
Note that the development version of this code is actually being tracked
in the fossil repo at
http://chiselapp.com/user/mwm/repository/vcs_info

Added vcs_info/VCS_INFO_detect_fossil.



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
## vim:ft=zsh
## fossil support by: Mike Meyer <mwm@mired.org>
## Distributed under the same BSD-ish license as zsh itself.

setopt localoptions NO_shwordsplit

[[ $1 == '--flavours' ]] && return 1

VCS_INFO_check_com ${vcs_comm[cmd]} || return 1
vcs_comm[detect_need_file]=_FOSSIL_
VCS_INFO_bydir_detect . || return 1

return 0

Added 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
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
## 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

# Build the revision display
zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" fsrevformat revformat || revformat="%.10h"

hook_com=( "hash" "${fshash}" )

if VCS_INFO_hook 'set-fsrev-format' "${revformat}"; then
    zformat -f fsrev "${revformat}" "h:${hook_com[hash]}"
else
    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