summaryrefslogtreecommitdiff
path: root/Functions/VCS_Info
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/VCS_Info')
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_detect_fossil2
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_git7
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_hg13
-rw-r--r--Functions/VCS_Info/VCS_INFO_quilt8
4 files changed, 18 insertions, 12 deletions
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_fossil b/Functions/VCS_Info/Backends/VCS_INFO_detect_fossil
index 551528361..a44b33eb5 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_detect_fossil
+++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_fossil
@@ -7,7 +7,7 @@ setopt localoptions NO_shwordsplit
[[ $1 == '--flavours' ]] && return 1
VCS_INFO_check_com ${vcs_comm[cmd]} || return 1
-vcs_comm[detect_need_file]=_FOSSIL_
+vcs_comm[detect_need_file]="_FOSSIL_ .fslckout"
VCS_INFO_bydir_detect . || return 1
return 0
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 9364fd021..e40571a0e 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -129,12 +129,13 @@ rrn=${gitbase:t}
local patchdir=${gitdir}/patches/${gitbranch}
if [[ -d $patchdir ]] ; then
- local -a stgit_applied stgit_unapplied
+ local -a stgit_applied stgit_unapplied stgit_all
stgit_applied=(${(f)"$(< "${patchdir}/applied")"})
stgit_applied=( ${(Oa)stgit_applied} )
stgit_unapplied=(${(f)"$(< "${patchdir}/unapplied")"})
stgit_unapplied=( ${(oa)stgit_unapplied} )
+ stgit_all=( ${(Oa)stgit_applied} ${stgit_unapplied} )
if VCS_INFO_hook 'gen-applied-string' "${stgit_applied[@]}"; then
if (( ${#stgit_applied} )); then
@@ -158,10 +159,10 @@ if [[ -d $patchdir ]] ; then
zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" nopatch-format stgitmsg || stgitmsg="no patch applied"
fi
hook_com=( applied "${stgitpatch}" unapplied "${stgitunapplied}"
- applied-n ${#stgit_applied} unapplied-n ${#stgit_unapplied} )
+ applied-n ${#stgit_applied} unapplied-n ${#stgit_unapplied} all-n ${#stgit_all} )
if VCS_INFO_hook 'set-patch-format' "${stgitmsg}"; then
zformat -f stgitmsg "${stgitmsg}" "p:${hook_com[applied]}" "u:${hook_com[unapplied]}" \
- "n:${#stgit_applied}" "c:${#stgit_unapplied}"
+ "n:${#stgit_applied}" "c:${#stgit_unapplied}" "a:${#stgit_all}"
else
stgitmsg=${hook_com[patch-replace]}
fi
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
index a1b87f59e..cedaf5676 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
@@ -37,12 +37,15 @@ VCS_INFO_adjust
# Calling the 'hg' program is quite a bit too slow for prompts.
# Disabled by default anyway, so no harm done.
if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then
- # Calling hexdump is (much) faster than hg but doesn't get the local rev
if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" use-simple \
&& ( VCS_INFO_check_com hexdump ) && [[ -r ${dirstatefile} ]] ; then
+ # Calling hexdump is (much) faster than hg but doesn't get the local rev
r_csetid=$(hexdump -n 20 -e '1/1 "%02x"' ${dirstatefile})
else
- hgid_args=( --debug id -i -n -b )
+ # Settling for a short (but unique!) hash because getting the full
+ # 40-char hash in addition to all the other info we want isn't
+ # available in a single hg invocation
+ hgid_args=( id -i -n -b )
# Looking for changes is a tad bit slower since the dirstate cache must
# first be refreshed before being read
@@ -119,7 +122,7 @@ if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-bookmarks \
&& [[ -r "${bmfile}" ]] && [[ -n "$r_csetid" ]] ; then
while read -r i_bmhash i_bmname ; do
# Compare hash in bookmarks file with changeset id
- [[ $r_csetid == $i_bmhash ]] && hgbmarks+=( $i_bmname )
+ [[ $i_bmhash == $r_csetid* ]] && hgbmarks+=( $i_bmname )
done < ${bmfile}
if VCS_INFO_hook 'gen-hg-bookmark-string' "${hgbmarks[@]}"; then
@@ -213,13 +216,13 @@ if zstyle -T ":vcs_info:${vcs}:${usercontext}:${rrn}" get-mq \
fi
hook_com=( applied "${applied_string}" unapplied "${unapplied_string}"
- applied-n ${#mqpatches} unapplied-n ${#mqunapplied}
+ applied-n ${#mqpatches} unapplied-n ${#mqunapplied} all-n ${#mqseries}
guards "${guards_string}" guards-n ${#mqguards} )
if VCS_INFO_hook 'set-patch-format' ${qstring}; then
zformat -f hgmqstring "${hgmqstring}" \
"p:${hook_com[applied]}" "u:${hook_com[unapplied]}" \
- "n:${#mqpatches}" "c:${#mqunapplied}" \
+ "n:${#mqpatches}" "c:${#mqunapplied}" "a:${#mqseries}" \
"g:${hook_com[guards]}" "G:${#mqguards}"
else
hgmqstring=${hook_com[patch-replace]}
diff --git a/Functions/VCS_Info/VCS_INFO_quilt b/Functions/VCS_Info/VCS_INFO_quilt
index fc127c23b..7001eca07 100644
--- a/Functions/VCS_Info/VCS_INFO_quilt
+++ b/Functions/VCS_Info/VCS_INFO_quilt
@@ -89,7 +89,7 @@ function VCS_INFO_quilt() {
local patches pc tmp qstring root
local -i ret
local -x context
- local -a applied unapplied applied_string unapplied_string quiltcommand
+ local -a applied unapplied all applied_string unapplied_string quiltcommand
local -Ax hook_com
context=":vcs_info:${vcs}.quilt-${mode}:${usercontext}:${rrn}"
@@ -142,6 +142,8 @@ function VCS_INFO_quilt() {
unapplied=()
fi
+ all=( ${(Oa)applied} ${unapplied} )
+
if VCS_INFO_hook 'gen-applied-string' "${applied[@]}"; then
if (( ${#applied} )); then
applied_string=${applied[1]}
@@ -164,10 +166,10 @@ function VCS_INFO_quilt() {
zstyle -s "${context}" nopatch-format qstring || qstring="no patch applied"
fi
hook_com=( applied "${applied_string}" unapplied "${unapplied_string}"
- applied-n ${#applied} unapplied-n ${#unapplied} )
+ applied-n ${#applied} unapplied-n ${#unapplied} all-n ${#all} )
if VCS_INFO_hook 'set-patch-format' ${qstring}; then
zformat -f qstring "${qstring}" "p:${hook_com[applied]}" "u:${hook_com[unapplied]}" \
- "n:${#applied}" "c:${#unapplied}"
+ "n:${#applied}" "c:${#unapplied}" "a:${#all}"
else
qstring=${hook_com[patch-replace]}
fi