Skip to content

Commit

Permalink
util: show all dirty status indicators
Browse files Browse the repository at this point in the history
Summary: Instead of just showing `?` or `*`, show one of each symbol in the
dirty status.  This means there will be a maximum of 5 characters at the end of
the prompt, which is fine.

Test Plan: N/A

Question for reviewer: I am having trouble running the test suite for Sapling.
I'd appreciate some help getting this working.  I can provide more details if
you wouldn't mind helping
  • Loading branch information
vegerot committed Dec 23, 2022
1 parent de3b1d9 commit d450738
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions eden/scm/contrib/scm-prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,9 @@ _hg_prompt() {
# cf. https://www.internalfb.com/intern/qa/4964/how-do-i-show-the-mercurial-bookmarkgit-branch-in?answerID=540621130023036
_hg_dirty() {
if [ -n "${SHOW_DIRTY_STATE}" ] &&
[ "$(hg config shell.showDirtyState)" != "false" ]; then
command hg status 2> /dev/null \
| command awk '$1 == "?" { print "?" } $1 != "?" { print "*" }' \
| command sort | command uniq | command head -c1
[ "$(sl config shell.showDirtyState)" != "false" ]; then
sl status 2> /dev/null \
| awk '{printf " "} {print $1}' | sort | uniq | paste -sd ' ' -
fi
}

Expand Down

0 comments on commit d450738

Please sign in to comment.