Skip to content

Instantly share code, notes, and snippets.

@nakamuray
Created November 7, 2013 01:41
Show Gist options
  • Save nakamuray/7347511 to your computer and use it in GitHub Desktop.
Save nakamuray/7347511 to your computer and use it in GitHub Desktop.
add mq's qqueue support to zsh vcs_info
--- VCS_INFO_get_data_hg.orig 2013-11-07 10:37:51.044470438 +0900
+++ VCS_INFO_get_data_hg 2013-11-07 10:38:07.448264214 +0900
@@ -6,7 +6,7 @@
setopt localoptions extendedglob NO_shwordsplit
local hgbase bmfile branchfile rebasefile dirstatefile mqseriesfile \
- mqstatusfile mqguardsfile patchdir mergedir \
+ mqstatusfile mqguardsfile patchq patchdir mergedir \
r_csetid r_lrev r_branch i_bmhash i_bmname \
revformat branchformat hgactionstring hgchanges \
hgbmstring hgmqstring applied_string unapplied_string guards_string
@@ -21,7 +21,14 @@
rrn=${hgbase:t}
r_csetid='' # changeset id (long hash)
r_lrev='' # local revision
-patchdir="${hgbase}/.hg/patches"
+if [[ -f "${hgbase}/.hg/patches.queue" ]]; then
+ patchq=$( < "${hgbase}/.hg/patches.queue" )
+fi
+if [[ -n "${patchq}" ]]; then
+ patchdir="${hgbase}/.hg/patches-${patchq}"
+else
+ patchdir="${hgbase}/.hg/patches"
+fi
mergedir="${hgbase}/.hg/merge/"
bmfile="${hgbase}/.hg/bookmarks"
branchfile="${hgbase}/.hg/branch"
@@ -215,6 +222,10 @@
hgmqstring || hgmqstring="no patch applied"
fi
+ if [[ -n "${patchq}" ]]; then
+ hgmqstring="${patchq}/${hgmqstring}"
+ fi
+
hook_com=( applied "${applied_string}" unapplied "${unapplied_string}"
applied-n ${#mqpatches} unapplied-n ${#mqunapplied} all-n ${#mqseries}
guards "${guards_string}" guards-n ${#mqguards} )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment