diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | Functions/VCS_Info/Backends/VCS_INFO_get_data_hg | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog index 429a258ec..d6fd08e48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-04-21 Daniel Shahaf <d.s@daniel.shahaf.name> + + * users/26635 (tweaked): + Functions/VCS_Info/Backends/VCS_INFO_get_data_hg: vcs_info hg: + Compute the branch name correctly when get-revision is set and + check-for-changes is not + 2021-04-20 Bart Schaefer <schaefer@zsh.org> * 48638: NEWS: mention TYPESET_TO_UNSET 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 |