From 9353b12e99827b29b224e5860bcb94636558d01a Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 7 Apr 2021 21:48:48 +0000 Subject: users/26635 (tweaked): vcs_info hg: Compute the branch name correctly when get-revision is set and check-for-changes is not Tweak: Simplify an always-true condition. Review-by: Manuel Jacob --- Functions/VCS_Info/Backends/VCS_INFO_get_data_hg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Functions') diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg index f7e9d6f45..2806aee1d 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg @@ -49,7 +49,7 @@ if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then # 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 ) + hgid_args=( id -i -n ) # Looking for changes is a tad bit slower since the dirstate cache must # first be refreshed before being read @@ -58,12 +58,12 @@ if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then local HGPLAIN HGPLAIN=1 ${vcs_comm[cmd]} ${(z)hgid_args} 2> /dev/null \ - | read -r r_csetid r_lrev r_branch + | read -r r_csetid r_lrev fi fi # If the user doesn't opt to invoke hg we can still get the current branch -if [[ -z ${r_branch} && -r ${branchfile} ]] ; then +if [[ -r ${branchfile} ]] ; then r_branch=$(< ${branchfile}) fi -- cgit 1.4.1