mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-26 20:31:15 +01:00
feat(ys): add setting to hide dirty info in hg repositories (#8415)
On large mercurial projects, using `hg status` to show dirty prompt causes significant delay. This commit checks a local hg config value of `oh-my-zsh.hide-dirty` to skip dirty check. Users who wish to skip dirty check can add this to their `.hg/hgrc` file. ``` [oh-my-zsh] hide-dirty = 1 ``` This config value uses the same naming as ones found for git, in file lib/git.zsh.
This commit is contained in:
parent
12669f29f0
commit
b3d1826a43
1 changed files with 6 additions and 4 deletions
|
@ -26,11 +26,13 @@ ys_hg_prompt_info() {
|
||||||
if [ -d '.hg' ]; then
|
if [ -d '.hg' ]; then
|
||||||
echo -n "${YS_VCS_PROMPT_PREFIX1}hg${YS_VCS_PROMPT_PREFIX2}"
|
echo -n "${YS_VCS_PROMPT_PREFIX1}hg${YS_VCS_PROMPT_PREFIX2}"
|
||||||
echo -n $(hg branch 2>/dev/null)
|
echo -n $(hg branch 2>/dev/null)
|
||||||
|
if [[ "$(hg config oh-my-zsh.hide-dirty 2>/dev/null)" != "1" ]]; then
|
||||||
if [ -n "$(hg status 2>/dev/null)" ]; then
|
if [ -n "$(hg status 2>/dev/null)" ]; then
|
||||||
echo -n "$YS_VCS_PROMPT_DIRTY"
|
echo -n "$YS_VCS_PROMPT_DIRTY"
|
||||||
else
|
else
|
||||||
echo -n "$YS_VCS_PROMPT_CLEAN"
|
echo -n "$YS_VCS_PROMPT_CLEAN"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
echo -n "$YS_VCS_PROMPT_SUFFIX"
|
echo -n "$YS_VCS_PROMPT_SUFFIX"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue