diff --git a/scripts/scm-prompt.sh b/scripts/scm-prompt.sh --- a/scripts/scm-prompt.sh +++ b/scripts/scm-prompt.sh @@ -108,6 +108,10 @@ extra="|REBASE" elif [[ -d "$hg/.hg/merge" ]]; then extra="|MERGE" + elif [[ -L "$hg/.hg/store/lock" ]]; then + extra="|STORE-LOCKED" + elif [[ -L "$hg/.hg/wlock" ]]; then + extra="|WDIR-LOCKED" fi local dirstate=$( \ (test -f "$hg/.hg/dirstate" && \ diff --git a/tests/test-scm-prompt-hg.t b/tests/test-scm-prompt-hg.t --- a/tests/test-scm-prompt-hg.t +++ b/tests/test-scm-prompt-hg.t @@ -231,6 +231,16 @@ $ _scm_prompt ':%s:' :97af35b: (no-eol) +Test locked repo states (generally due to concurrency so tests are kinda fake) + $ cmd ln -s "${HOSTNAME}:12345" .hg/wlock + (97af35b|WDIR-LOCKED) + $ cmd ln -s "${HOSTNAME}:12345" .hg/store/lock + (97af35b|STORE-LOCKED) + $ cmd rm .hg/wlock + (97af35b|STORE-LOCKED) + $ cmd rm .hg/store/lock + (97af35b) + Test many remotenames $ hg log -r . -T '{node}\n' 97af35b3648c0098cbd8114ae1b1bafab997ac20