scm-prompt: add eden snapshots support

Summary:
Based on the recent commit wez made, but centralized to the scm-prompt
source-of-truth.

Test Plan: updated test

Reviewers: #sourcecontrol, wez, simpkins, simonfar

Reviewed By: simonfar

Subscribers: net-systems-diffs@fb.com, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4867662

Tasks: 17110799

Signature: t1:4867662:1491916786:647edb819a059a3a6baa09c8d189ea706933687b
This commit is contained in:
Ryan McElroy 2017-04-11 08:47:12 -07:00
parent 3ded80a5c7
commit 8267123b73
2 changed files with 12 additions and 2 deletions

View File

@ -109,8 +109,11 @@ _scm_prompt()
elif [[ -d "$hg/.hg/merge" ]]; then
extra="|MERGE"
fi
local dirstate=$(test -f "$hg/.hg/dirstate" && \
command hexdump -vn 20 -e '1/1 "%02x"' "$hg/.hg/dirstate" || \
local dirstate=$( \
(test -f "$hg/.hg/dirstate" && \
command hexdump -vn 20 -e '1/1 "%02x"' "$hg/.hg/dirstate") || \
(test -f "$hg/.eden/client/SNAPSHOT" && \
command cat "$hg/.eden/client/SNAPSHOT") || \
command echo "empty")
local active="$hg/.hg/bookmarks.current"
if [[ -f "$active" ]]; then

View File

@ -245,3 +245,10 @@ Test many remotenames
$ echo 97af35b3648c0098cbd8114ae1b1bafab997ac20 bookmarks remote/@ >> .hg/remotenames
$ cmd
(97af35b|remote/@...)
Test eden snapshots
$ mkdir -p .eden/client/
$ echo "deadbeefcafeface000000000000000000000000" > .eden/client/SNAPSHOT
$ rm .hg/dirstate
$ cmd
(deadbee)