vcs_info
Check-in [8b2ab08df7]
Not logged in
Public Repositories
mwm's Repositories

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

Overview
Comment:Add working _get_data_fossil, and update README to match.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:8b2ab08df7650e16c5ea32c129001b90bbf15b5b
User & Date: mwm 2011-02-19 07:45:44
Context
2011-02-19
07:50
Doc cleanup. check-in: c6606f45f5 user: mwm tags: trunk
07:45
Add working _get_data_fossil, and update README to match. check-in: 8b2ab08df7 user: mwm tags: trunk
04:45
A working version of detect_fossil check-in: cd855d8051 user: mwm tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to README.wiki.

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

13
14
15
16
17
18





19
20
21

22





















<h1>NOT DONE YET</h1>

Should you have wondered accross this early, note that it is <b>not</b> done yet!
Don't install it!
If you install it and break your zsh setup, don't blame me.

<h2>Installation</h2>

The VCS_INFO*fossil files should be copied to
<prefix>/share/zsh/<version>/functions/VCS_Info/Backends.
<prefix> is probably either /usr/local or /usr, depending on your system.
<version> can be found by doing <tt>zsh --version</tt>.


Beware the VCS_INFO*hg files. These are <i>improved</i> versions of the files
as shipped with zsh. If you are running zsh newer than version 3.10, installing
them may well cause vcs_info to lose functionality. If you want the extra functionality,
compare them with the files they would overwrite.






<h2>Usage</h2>

TBD.

 





















<
<
<
<
<
<



|
|
|
>

<
|
|
<

>
>
>
>
>


<
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






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






<h2>Installation</h2>

The VCS_INFO*fossil files should be copied to
<tt><prefix>/share/zsh/<version>/functions/VCS_Info/Backends</tt>.
<prefix> is probably either <tt>/usr/local</tt> or <tt>/usr</tt>,
depending on your system.  <version> can be found by doing <tt>zsh
--version</tt>.


Then, as root in the <tt><prefix>/share/zsh/<version>/functions</tt>
directory, run:


<pre><tt>
setopt extendedglob nomark_dirs
zcompile -U -M VCS_Info.zwc VCS_Info/*~*.zwc(^/)
</tt></pre>

<h2>Usage</h2>


Usage is pretty muc the same as it is for any other VCS.

Revision print the first 10 digits of the artifact id by default. You
can change this by setting the fsrevformat variable like so:

<tt>zstyle ':vcs_info:fossil:*' fsrevformat '%.<max>h'</tt>

h is the only valid format character. Change <tt><max></tt> to the
number of digits you want to display. As indicated, the default is
<tt>%.10h</tt>. Changing the format to <tt>'%h'</tt> will print the
entire artifact id (not recommended).  Open a ticket (see below) if
you think this should change.

The misc field is currently set to the repository. Suggestions for
alternatives are welcome (data from <tt>fossil status</tt> preferred).

<h2>Bugs, complaints, suggestions, etc.</h2>

Best to
[https://chiselapp.com/user/mwm/repository/vcs_info/reportlist|open a
ticket] at the chiselapp repo for the software.


Changes to VCS_INFO_detect_fossil.

7
8
9
10
11
12
13

[[ $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








>
7
8
9
10
11
12
13
14
[[ $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
foo

Added 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
## 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
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