Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: vcs_info quilt: fix unapplied detection in subdir
- X-seq: zsh-workers 34333
- From: Marc Finet <m.dreadlock@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: vcs_info quilt: fix unapplied detection in subdir
- Date: Tue, 20 Jan 2015 22:55:07 +0100
- Cc: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=goDUqf5acEpF087G8JXRv68mc9ZSZSwMhZeT+wo4tnY=; b=XhZy/24+cnJzNjNheLE8oNfEqXZbWKq4O8LmNo1zqin3gqC7CEY87UawiXOgZMjPnY NEAYOoIu44CtPiM94SjejtZ2ZDR5c61WX/lESB+9xTO9y4VPqNRxSc+hWFTvfqhwDiUN AmQjC9SiFcS/r/jMsW5BvtZU7/d/bOBRKvEsZ+7NjqCGt82LDDzAdi79ghUHh7PZAPZr dqaj/Ua7NOnkK0dYoH/ClYQrctXgD81yLE9Die0oB9Um0YK5k6J+R3VSDzDDsVuT+9MZ 0WPeSAiXQnDrZjF8ZLuHRG2Vscnk1f2LE4gGpgsARZgyibF3Cu/aNBFeDVIlyFU+Vnk9 DINA==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
When patches are applied, let quilt use .pc without forcing the
patch directory, this will fix the unapplied detection when being in
subdir.
When no patches are applied, use zstyle quilt-patch-dir then
QUILT_PATCHES then "patches" for path to search for patches.
Note: prefer setting quilt-patch-dir rather than QUILT_PATCHES for
absolute path because when patches are applied, quilt unapplied will
not return the correct list (i.e. the whole list rather that the one
specified by .pc/.quilt_series).
---
Functions/VCS_Info/VCS_INFO_quilt | 30 +++++++++++++++++-------------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/Functions/VCS_Info/VCS_INFO_quilt b/Functions/VCS_Info/VCS_INFO_quilt
index db15dda..34ff1ed 100644
--- a/Functions/VCS_Info/VCS_INFO_quilt
+++ b/Functions/VCS_Info/VCS_INFO_quilt
@@ -87,7 +87,7 @@ function VCS_INFO_quilt() {
local patches pc tmp qstring root
local -i ret
local -x context
- local -a applied unapplied all applied_string unapplied_string quiltcommand
+ local -a applied unapplied all applied_string unapplied_string quiltcommand quilt_env
local -Ax hook_com
context=":vcs_info:${vcs}.quilt-${mode}:${usercontext}:${rrn}"
@@ -105,17 +105,6 @@ function VCS_INFO_quilt() {
;;
esac
- zstyle -s "${context}" quilt-patch-dir patches || patches="${QUILT_PATCHES}"
- if [[ "${patches}" != /* ]]; then
- tmp=${patches:-patches}
- patches="$(VCS_INFO_quilt-dirfind "${tmp}")"
- ret=$?
- (( ret )) && return ${ret}
- patches=${patches}/${tmp}
- else
- [[ -d ${patches} ]] || return 1
- fi
-
pc="$(VCS_INFO_quilt-dirfind .pc .version)"
ret=$?
if (( ret == 0 )); then
@@ -129,12 +118,27 @@ function VCS_INFO_quilt() {
else
applied=()
fi
+ patches=$(<$pc/.quilt_patches)
fi
if zstyle -t "${context}" get-unapplied; then
# This zstyle call needs to be moved further up if `quilt' needs
# to be run in more places than this one.
zstyle -s "${context}" quiltcommand quiltcommand || quiltcommand='quilt'
- unapplied=( ${(f)"$(QUILT_PATCHES=$patches $quiltcommand --quiltrc /dev/null unapplied 2> /dev/null)"} )
+ quilt_env=(env)
+ if [ -z "$patches" ]; then
+ zstyle -s "${context}" quilt-patch-dir patches || patches="${QUILT_PATCHES}"
+ if [[ "${patches}" != /* ]]; then
+ tmp=${patches:-patches}
+ patches="$(VCS_INFO_quilt-dirfind "${tmp}")"
+ ret=$?
+ (( ret )) && return ${ret}
+ patches=${patches}/${tmp}
+ else
+ [[ -d ${patches} ]] || return 1
+ fi
+ quilt_env+=(QUILT_PATCHES="$patches")
+ fi
+ unapplied=( ${(f)"$(${quilt_env[@]} $quiltcommand --quiltrc /dev/null unapplied 2> /dev/null)"} )
unapplied=( ${unapplied:#} )
else
unapplied=()
--
2.1.4
Messages sorted by:
Reverse Date,
Date,
Thread,
Author