about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--Doc/Zsh/contrib.yo7
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_detect_fossil13
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_fossil24
4 files changed, 50 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index a595be973..9141f9c6b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-03-20  Frank Terbeck  <ft@bewatermyfriend.org>
+
+	* Mike Meyer: 28956, 28957:
+	Functions/VCS_Info/Backends/VCS_INFO_detect_fossil,
+	Functions/VCS_Info/Backends/VCS_INFO_get_data_fossil,
+	Doc/Zsh/contrib.yo: Add fossil support to vcs_info.
+
 2011-03-29  Mikael Magnusson <mikachu@gmail.com>
 
 	* unposted: Completion/Unix/Command/_vim: Fix typo in
@@ -14387,5 +14394,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5233 $
+* $Revision: 1.5234 $
 *****************************************************
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index 5b9af12f3..81167bf3e 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -600,6 +600,7 @@ sitem(Bazaar (tt(bzr)))(http://bazaar-vcs.org/)
 sitem(Codeville (tt(cdv)))(http://codeville.org/)
 sitem(Concurrent Versioning System (tt(cvs)))(http://www.nongnu.org/cvs/)
 sitem(Darcs (tt(darcs)))(http://darcs.net/)
+sitem(Fossil (tt(fossil)))(http://fossil-scm.org/)
 sitem(Git (tt(git)))(http://git-scm.com/)
 sitem(GNU arch (tt(tla)))(http://www.gnu.org/software/gnu-arch/)
 sitem(Mercurial (tt(hg)))(http://mercurial.selenic.com/)
@@ -649,6 +650,7 @@ bzr
 cdv
 cvs
 darcs
+fossil
 git
 hg
 mtn
@@ -692,8 +694,9 @@ example(:vcs_info:<vcs-string>:<user-context>:<repo-root-name>)
 startitem()
 item(tt(<vcs-string>))(
 is one of: git, git-svn, git-p4, hg, hg-git, hg-hgsubversion, hg-hgsvn,
-darcs, bzr, cdv, mtn, svn, cvs, svk, tla or p4. When hooks are active the
-hooks name is added after a `+'. (See tt(Hooks in vcs_info) below.)
+darcs, bzr, cdv, mtn, svn, cvs, svk, tla, p4 or fossil. When hooks are
+active the hooks name is added after a `+'. (See tt(Hooks in vcs_info)
+below.)
 )
 item(tt(<user-context>))(
 is a freely configurable string, assignable by
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_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