From 3aae0ef8fecd69c983e6452a6b4f9c641cac9ab1 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Fri, 17 Aug 2012 08:22:52 +0000 Subject: Stepan Koltsov: vcs_info: %a to output number of all patches in (no)?patch-format styles --- Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 7 ++++--- Functions/VCS_Info/Backends/VCS_INFO_get_data_hg | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'Functions/VCS_Info/Backends') 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..48e385c97 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg @@ -213,13 +213,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]} -- cgit v1.2.3 From feb6169bcd8920ccda0ee20b8089d9f3ca8010ba Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Fri, 28 Sep 2012 22:07:29 +0000 Subject: Seth House: 30702: contrib.yo, VCS_INFO_get_data_hg: Removed --debug flag from the hg vcs_info backend --- ChangeLog | 8 +++++++- Doc/Zsh/contrib.yo | 7 +++++-- Functions/VCS_Info/Backends/VCS_INFO_get_data_hg | 9 ++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) (limited to 'Functions/VCS_Info/Backends') diff --git a/ChangeLog b/ChangeLog index 27ee25112..f98b6c925 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-09-29 Frank Terbeck + + * Seth House: 30702: Doc/Zsh/contrib.yo, + Functions/VCS_Info/Backends/VCS_INFO_get_data_hg: Removed --debug + flag from the hg vcs_info backend + 2012-09-28 Oliver Kiddle * 30697: Completion/Unix/Command/_dbus: new completion definition @@ -179,5 +185,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5724 $ +* $Revision: 1.5725 $ ***************************************************** diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 24aafc331..8dbc095fd 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -768,7 +768,10 @@ item(tt(hgrevformat))( tt(hg) uses both a hash and a revision number to reference a specific changeset in a repository. With this style you can format the revision string (see tt(branchformat)) to include either or both. It's only -useful when tt(get-revision) is true. +useful when tt(get-revision) is true. Note, the full 40-character revision id +is not available (except when using the tt(use-simple) option) because +executing hg more than once per prompt is too slow; you may customize this +behavior using hooks. ) kindex(max-exports) item(tt(max-exports))( @@ -993,7 +996,7 @@ In tt(hgrevformat) these replacements are done: startsitem() sitem(tt(%r))(The current local revision number.) -sitem(tt(%h))(The current 40-character changeset ID hash identifier.) +sitem(tt(%h))(The current global revision identifier.) endsitem() In tt(patch-format) and tt(nopatch-format) these replacements are done: diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg index 48e385c97..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 -- cgit v1.2.3 From 2e6363ed505157fd09f3f473356912bddf8ba640 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Fri, 28 Sep 2012 22:11:32 +0000 Subject: Baptiste Daroussin: 30703: VCS_INFO_detect_fossil: Fix fossil detection on unix --- ChangeLog | 6 +++++- Functions/VCS_Info/Backends/VCS_INFO_detect_fossil | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'Functions/VCS_Info/Backends') diff --git a/ChangeLog b/ChangeLog index 31c4cc4d9..d1ed83a0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,10 @@ * Seth House: 30701: Misc/vcs_info-examples: Added an hg hook example to restore the 40-char hash + * Baptiste Daroussin: 30703: + Functions/VCS_Info/Backends/VCS_INFO_detect_fossil: Fix fossil + detection on unix + 2012-09-28 Oliver Kiddle * 30697: Completion/Unix/Command/_dbus: new completion definition @@ -188,5 +192,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5726 $ +* $Revision: 1.5727 $ ***************************************************** 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 -- cgit v1.2.3