From 2bc695a4303c4259d04407181f677a5c13d92216 Mon Sep 17 00:00:00 2001 From: Henrik Ravn Date: Tue, 18 Jul 2017 10:33:58 +0200 Subject: [PATCH] Added support for DISABLE_UNTRACKED_FILES_DIRTY When DISABLE_UNTRACKED_FILES_DIRTY is true, add --quiet flag to hg status command. This effectively disables untracted fiels form the durty check. --- plugins/mercurial/mercurial.plugin.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh index 3ae59496..352a4bec 100644 --- a/plugins/mercurial/mercurial.plugin.zsh +++ b/plugins/mercurial/mercurial.plugin.zsh @@ -40,8 +40,12 @@ $ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_PROMPT_BASE_COLOR$ } function hg_dirty_choose { + local FLAGS if [ $(in_hg) ]; then - hg status 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]' + if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then + FLAGS+='--quiet' + fi + hg status ${FLAGS} 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]' if [ $pipestatus[-1] -eq 0 ]; then # Grep exits with 0 when "One or more lines were selected", return "dirty". echo $1