Page MenuHomePhabricator

scm-prompt: add locked state
ClosedPublic

Authored by ryanmce on Sep 22 2017, 9:10 AM.

Details

Reviewers
stash
Group Reviewers
Restricted Project
Commits
rFBHGXb6676a0d1298: scm-prompt: add locked state
Summary

If you're working n multiple terminals on the same repository, it is
often useful to know if a command you're about to run might block due to an
already-held lock on the repository. This upgrade to scm-prompt gives the
user this information.

Test Plan

updated the test

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ryanmce created this revision.Sep 22 2017, 9:10 AM
stash accepted this revision.Sep 22 2017, 10:55 AM
stash added a subscriber: stash.

I'm not sure if there is an easy way to fix it, but names like WDIR-LOCKED and STORE-LOCKED are quite confusing to users. Maybe simple LOCKED is clearer to users unfamiliar with hg internals, and experienced users can find out on their own whether it's wdir locked or store locked?

tests/test-scm-prompt-hg.t
235–238

In that case I'd expect it to print both - "|WDIR-LOCKED|STORE-LOCKED"

This revision is now accepted and ready to land.Sep 22 2017, 10:55 AM

I'm not sure if there is an easy way to fix it, but names like WDIR-LOCKED and STORE-LOCKED are quite confusing to users. Maybe simple LOCKED is clearer to users unfamiliar with hg internals, and experienced users can find out on their own whether it's wdir locked or store locked?

I thought about this and I don't have a really strong reason to go one way or another. Power users will probably like this. We'll iterate if there's confusion.

tests/test-scm-prompt-hg.t
235–238

Because of lock ordering, the WDIR will always be locked when the STORE is locked, so I don't think it adds much value.

This revision was automatically updated to reflect the committed changes.