IMPROVED: untracked file status has priority over modified (ie: if you have both modified and untracked files, your prompt will be red indicating the presence of untracked files)
Diff
1diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
2index e2074b713b8f267dafa217e335512e995a223ba6..75e09577681863ca7fba4787bb29acd2559b55c6 100644
3--- a/themes/agnoster.zsh-theme
4+++ b/themes/agnoster.zsh-theme
5@@ -87,12 +87,11 @@ prompt_hg() {
6 local rev status
7 if $(hg id >/dev/null 2>&1); then
8 if $(hg prompt >/dev/null 2>&1); then
9- st=$(hg prompt {status})
10- if [[ $st = "?" ]]; then
11+ if [[ $(hg prompt "{status|unknown}") = "?" ]]; then
12 # if files are not added
13 prompt_segment red white
14 st='±'
15- elif [[ -n $st ]]; then
16+ elif [[ -n $(hg prompt "{status|modified}") ]]; then
17 # if any modification
18 prompt_segment yellow black
19 st='±'