Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 2/3] vcs_info/cvs: set vcs_comm[basedir] in VCS_INFO_detect_cvs
- X-seq: zsh-workers 44920
- From: Aleksandr Mezin <mezin.alexander@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 2/3] vcs_info/cvs: set vcs_comm[basedir] in VCS_INFO_detect_cvs
- Date: Sun, 24 Nov 2019 04:14:42 +0600
- Cc: Aleksandr Mezin <mezin.alexander@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sW2EaEMalISG505Iz/dt6IK8/hKwa6rB0P1CPj/NvfI=; b=f0VAvG0hgHnYIurAS0ywngATAmqC7rwm2kQvxqhnT4ThS++arNd1wW8wNj2fEmAyCZ AriHamNJJRuQlEQPDEuo/IDlfifgSG0WoTX4kpE5KooQpNAH0RRSDcxIoCyDo32r3BBX TFSOobh+V71IxaCHSq7SC9IRY3JNvBor8Ww20jBICIj39z8QJrHkXbPQGoitnbV2+dxG vx+jsKWaGsH4XWJhMGAVjY0K/fq7q6z2TdqVU6R/gHZXJFy30FRBpbdpi+A3tdJxDChR Yt9kbs73DLIfoiWubIgfXaKgqXUGIxFMw8D/sSzNBrWo4H17VUCjn96qH/dYLjOivQPM ShVw==
- In-reply-to: <20191123221443.279556-1-mezin.alexander@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20191123221443.279556-1-mezin.alexander@gmail.com>
---
Functions/VCS_Info/Backends/VCS_INFO_detect_cvs | 11 +++++++++--
Functions/VCS_Info/Backends/VCS_INFO_get_data_cvs | 6 +-----
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_cvs b/Functions/VCS_Info/Backends/VCS_INFO_detect_cvs
index 7a5ee1eef..73b79f744 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_detect_cvs
+++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_cvs
@@ -7,5 +7,12 @@ setopt localoptions NO_shwordsplit
[[ $1 == '--flavours' ]] && return 1
VCS_INFO_check_com ${vcs_comm[cmd]} || return 1
-[[ -d "./CVS" ]] && [[ -r "./CVS/Repository" ]] && return 0
-return 1
+[[ -d "./CVS" ]] && [[ -r "./CVS/Repository" ]] || return 1
+
+local cvsbase="."
+while [[ -d "${cvsbase}/../CVS" ]]; do
+ cvsbase="${cvsbase}/.."
+done
+vcs_comm[basedir]=${cvsbase:P}
+
+return 0
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_cvs b/Functions/VCS_Info/Backends/VCS_INFO_get_data_cvs
index e9d172052..1ca0e9c16 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_cvs
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_cvs
@@ -5,11 +5,7 @@
setopt localoptions NO_shwordsplit
local cvsbranch cvsbase
-cvsbase="."
-while [[ -d "${cvsbase}/../CVS" ]]; do
- cvsbase="${cvsbase}/.."
-done
-cvsbase=${cvsbase:P}
+cvsbase=${vcs_comm[basedir]}
cvsbranch=$(< ./CVS/Repository)
rrn=${cvsbase:t}
cvsbranch=${cvsbranch##${rrn}/}
--
2.24.0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author