about summary refs log tree commit diff
path: root/Functions/VCS_Info/VCS_INFO_formats
diff options
context:
space:
mode:
authorFrank Terbeck <bewater@users.sourceforge.net>2010-05-10 10:46:48 +0000
committerFrank Terbeck <bewater@users.sourceforge.net>2010-05-10 10:46:48 +0000
commit0501efc54af2d194f952c2968a7aeeb5bac8fdf4 (patch)
tree9d632c46950c434594cc46263e35558018912b20 /Functions/VCS_Info/VCS_INFO_formats
parent144a06bf958b4e573fd3c78eab30536349d09cff (diff)
downloadzsh-0501efc54af2d194f952c2968a7aeeb5bac8fdf4.tar.gz
zsh-0501efc54af2d194f952c2968a7aeeb5bac8fdf4.tar.xz
zsh-0501efc54af2d194f952c2968a7aeeb5bac8fdf4.zip
Seth House, Simon Ruderich and myself: 27948: various vcs_info changes
Here's a diff-stat:

 Doc/Zsh/contrib.yo                                |  506 ++++++++++++++-------
 Functions/VCS_Info/.distfiles                     |    1 +
 Functions/VCS_Info/Backends/VCS_INFO_detect_hg    |   14 +-
 Functions/VCS_Info/Backends/VCS_INFO_get_data_git |   35 +-
 Functions/VCS_Info/Backends/VCS_INFO_get_data_hg  |  295 +++++++++----
 Functions/VCS_Info/VCS_INFO_formats               |   26 +-
 Functions/VCS_Info/VCS_INFO_hook                  |   10 +-
 Functions/VCS_Info/VCS_INFO_quilt                 |  190 ++++++++
 Functions/VCS_Info/vcs_info                       |   30 +-
 Misc/.distfiles                                   |    1 +
 Misc/vcs_info-examples                            |  496 ++++++++++++++++++++
 11 files changed, 1303 insertions(+), 301 deletions(-)

The major changes are vast improvements for the mercurial (hg) backend
(which was done almost entirely by Seth); improved documentation (mostly
done by Simon and again Seth); quilt support (as an addon and stand
alone, see the manual for details); a number of new hooks and a fair
share of bugfixes.
Diffstat (limited to 'Functions/VCS_Info/VCS_INFO_formats')
-rw-r--r--Functions/VCS_Info/VCS_INFO_formats26
1 files changed, 17 insertions, 9 deletions
diff --git a/Functions/VCS_Info/VCS_INFO_formats b/Functions/VCS_Info/VCS_INFO_formats
index db7a8dd48..469efa7d4 100644
--- a/Functions/VCS_Info/VCS_INFO_formats
+++ b/Functions/VCS_Info/VCS_INFO_formats
@@ -22,21 +22,18 @@ hook_com=(
     unstaged_orig "$5"
     revision      "$6"
     revision_orig "$6"
+    misc          "$7"
+    misc_orig     "$7"
     vcs           "${vcs}"
     vcs_orig      "${vcs}"
 )
-shift 6
-i=0
-for tmp in "$@"; do
-    hook_com[misc$((i++))]="${tmp}"
-done
-hook_com[misc]=${(j:,:)argv}
-hook_com[misc_orig]=${hook_com[misc]}
 hook_com[base-name]="${${hook_com[base]}:t}"
 hook_com[base-name_orig]="${hook_com[base_name]}"
 hook_com[subdir]="$(VCS_INFO_reposub ${hook_com[base]})"
 hook_com[subdir_orig]="${hook_com[subdir]}"
 
+VCS_INFO_hook 'post-backend'
+
 ## description:
 #   action:   a string that signals a certain non-default condition in the
 #             repository (like 'rebase-i' in git). If this in non-empty,
@@ -46,8 +43,7 @@ hook_com[subdir_orig]="${hook_com[subdir]}"
 #   staged:   non-empty if the repository contains staged changes.
 #   unstaged: non-empty if the repository contains unstaged changes.
 #   revision: an identifier of the currently checked out revision.
-#   misc0..N: a set of strings that may contain anything the author likes.
-#             the backends should document what they put in it and when.
+#   misc:     a string that may contain anything the backend author likes.
 #
 # If an argument has no valid value for a given backend, an empty value
 # should be provided. eg:
@@ -71,6 +67,15 @@ if [[ -n ${hook_com[unstaged]} ]] ; then
     [[ -z ${tmp} ]] && hook_com[unstaged]='U' || hook_com[unstaged]=${tmp}
 fi
 
+if [[ ${quiltmode} != 'standalone' ]] && VCS_INFO_hook "pre-addon-quilt"; then
+    local -x REPLY
+    VCS_INFO_quilt addon
+    hook_com[quilt]="${REPLY}"
+    unset REPLY
+elif [[ ${quiltmode} == 'standalone' ]]; then
+    hook_com[quilt]=${hook_com[misc]}
+fi
+
 (( ${#msgs} > maxexports )) && msgs[$(( maxexports + 1 )),-1]=()
 for i in {1..${#msgs}} ; do
     if VCS_INFO_hook "set-message" $(( $i - 1 )) "${msgs[$i]}"; then
@@ -83,6 +88,7 @@ for i in {1..${#msgs}} ; do
                         r:${hook_com[base-name]}        \
                         s:${hook_com[vcs]}              \
                         u:${hook_com[unstaged]}         \
+                        Q:${hook_com[quilt]}            \
                         R:${hook_com[base]}             \
                         S:${hook_com[subdir]}
         msgs[$i]=${msg}
@@ -90,4 +96,6 @@ for i in {1..${#msgs}} ; do
         msgs[$i]=${hook_com[message]}
     fi
 done
+hook_com=()
+backend_misc=()
 return 0