Sandbox for fossil

⌈⌋ ⎇ branch:  Sandbox


Check-in [032c3502ff]

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

Overview
Comment:Add zsh module
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 032c3502ff27dbcf028071ca24b7cf48cdafed208c6f800b5d0bdc41897605a4
User & Date: mrobinson 2019-06-03 20:30:53
Context
2019-06-03
20:52
Make links clickable check-in: a34cbc15ff user: brimstone tags: trunk
20:30
Add zsh module check-in: 032c3502ff user: mrobinson tags: trunk
19:45
Start readme check-in: c0da836aea user: mrobinson tags: trunk
Changes

Added 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
globalvar GIT_USE_ICONS 0 "Enables Icons in prompt"
globalvar GIT_FETCH_CACHE_TIME 3600 "Frequency in which the fossil remote cache should be checked"

function _deps(){
	app="fossil"

	$(hash $app 2>/dev/null) || ( myzsh error "Couldn't find application ${app}" && return 1 )
}

function fossil_func () {
	local infossil
	fossil branch >/dev/null 2>/dev/null
	infossil=$?
	if [ "$infossil" != 0 ]; then
		return
	fi
	local current_ver
	local min_ver
	local fossilstatus
	local stash

	branch=$(fossil branch | awk '/^\*/ {print $2}' | sed 's/(//')

	printf "%s" "$branch"

	fossilStatus="$(fossil status --differ | while read -r s _; do [[ "$s" =~ "^[A-Z]" ]] || continue; echo ${s:0:1}; done | uniq -c | while read -r a b; do printf " $b:$a"; done)"
	printf "%s" "${fossilStatus}"
}

# TODO
# - figure out self hosting, cgi maybe? https://www.fossil-scm.org/index.html/doc/trunk/www/server.wiki
# - get this added to a repo somewhere
# - repo sync script, omg
# - make 'checkout' make a directory, put repo in .fossil
# - make 'wiki edit' export to a mktemp, then commit it back

OUTPUT=fossil_func
# vim: filetype=zsh noexpandtab