summaryrefslogtreecommitdiff
path: root/Functions/VCS_Info/Backends
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/VCS_Info/Backends')
-rw-r--r--Functions/VCS_Info/Backends/.distfiles2
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_detect_fossil13
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_detect_hg2
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_detect_svn2
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_fossil24
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_hg2
6 files changed, 42 insertions, 3 deletions
diff --git a/Functions/VCS_Info/Backends/.distfiles b/Functions/VCS_Info/Backends/.distfiles
index 46e9d6e67..67fb06cda 100644
--- a/Functions/VCS_Info/Backends/.distfiles
+++ b/Functions/VCS_Info/Backends/.distfiles
@@ -4,6 +4,7 @@ VCS_INFO_detect_bzr
VCS_INFO_detect_cdv
VCS_INFO_detect_cvs
VCS_INFO_detect_darcs
+VCS_INFO_detect_fossil
VCS_INFO_detect_git
VCS_INFO_detect_hg
VCS_INFO_detect_mtn
@@ -15,6 +16,7 @@ VCS_INFO_get_data_bzr
VCS_INFO_get_data_cdv
VCS_INFO_get_data_cvs
VCS_INFO_get_data_darcs
+VCS_INFO_get_data_fossil
VCS_INFO_get_data_git
VCS_INFO_get_data_hg
VCS_INFO_get_data_mtn
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_fossil b/Functions/VCS_Info/Backends/VCS_INFO_detect_fossil
new file mode 100644
index 000000000..551528361
--- /dev/null
+++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_fossil
@@ -0,0 +1,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
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_hg b/Functions/VCS_Info/Backends/VCS_INFO_detect_hg
index e2866afd5..a22c1ee0f 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_detect_hg
+++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_hg
@@ -7,7 +7,7 @@ setopt localoptions NO_shwordsplit
[[ $1 == '--flavours' ]] && { print -l hg-git hg-hgsubversion hg-hgsvn; return 0 }
VCS_INFO_check_com ${vcs_comm[cmd]} || return 1
-vcs_comm[detect_need_file]=store
+vcs_comm[detect_need_file]="store data"
VCS_INFO_bydir_detect '.hg' || return 1
if [[ -d ${vcs_comm[basedir]}/.hg/svn ]] ; then
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_svn b/Functions/VCS_Info/Backends/VCS_INFO_detect_svn
index bb9d083ac..a777ecc43 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_detect_svn
+++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_svn
@@ -7,5 +7,5 @@ setopt localoptions NO_shwordsplit
[[ $1 == '--flavours' ]] && return 1
VCS_INFO_check_com ${vcs_comm[cmd]} || return 1
-[[ -d ".svn" ]] && return 0
+{ [[ -f ".svn/entries" ]] || [[ -f ".svn/format" ]] } && return 0
return 1
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_fossil b/Functions/VCS_Info/Backends/VCS_INFO_get_data_fossil
new file mode 100644
index 000000000..fd0f8389e
--- /dev/null
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_fossil
@@ -0,0 +1,24 @@
+## vim:ft=zsh
+## fossil support by: Mike Meyer (mwm@mired.org)
+## Distributed under the same BSD-ish license as zsh itself.
+
+setopt localoptions extendedglob
+local a b
+local -A fsinfo
+local fshash fsbranch changed merging action
+
+${vcs_comm[cmd]} status |
+ while IFS=: read a b; do
+ fsinfo[${a//-/_}]="${b## #}"
+ done
+
+fshash=${fsinfo[checkout]%% *}
+fsbranch=${fsinfo[tags]%%, *}
+changed=${(Mk)fsinfo:#(ADDED|EDITED|DELETED|UPDATED)*}
+merging=${(Mk)fsinfo:#*_BY_MERGE*}
+if [ -n "$merging" ]; then
+ action="merging"
+fi
+
+VCS_INFO_formats "$action" "${fsbranch}" "${fsinfo[local_root]}" '' "$changed" "${fshash}" "${fsinfo[repository]}"
+return 0
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
index 8e91d2651..a1b87f59e 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
@@ -50,7 +50,7 @@ if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then
"check-for-changes" || hgid_args+=( -r. )
local HGRCPATH
- HGRCPATH="/dev/null" ${vcs_comm[cmd]} ${(z)hgid_args} \
+ HGRCPATH="/dev/null" ${vcs_comm[cmd]} ${(z)hgid_args} 2> /dev/null \
| read -r r_csetid r_lrev r_branch
fi
fi