mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
ae5db40fdd
Summary:
Copied from D17312417 (e1f4dbeb3d
), because that did what I needed done, but incremented by 1.
I would like to change the length of the displayed hash in scm-prompt
to 9. Why such an impactful diff? Because hg sl shows 9 characters, and I
always get confused when the hash in my prompt doesn't match hg sl
Reviewed By: kulshrax
Differential Revision: D25934253
fbshipit-source-id: 15f2bc8bc7d666de1a077d2bafd74ab3c9753341
44 lines
772 B
Perl
44 lines
772 B
Perl
#chg-compatible
|
|
|
|
Initialize scm prompt compatibility layer
|
|
$ . $TESTDIR/../contrib/scm-prompt.sh
|
|
|
|
$ cmd() {
|
|
> "$@"
|
|
> _dotfiles_scm_info
|
|
> }
|
|
|
|
A few basic tests
|
|
$ _dotfiles_scm_info
|
|
$ hg init repo
|
|
$ cmd cd repo
|
|
(empty) (no-eol)
|
|
$ echo a > a
|
|
$ cmd hg add a
|
|
(000000000) (no-eol)
|
|
$ cmd hg commit -m 'c1'
|
|
(5cad84d17) (no-eol)
|
|
$ cmd hg book active
|
|
(active) (no-eol)
|
|
|
|
Test old mode
|
|
$ export WANT_OLD_SCM_PROMPT
|
|
$ WANT_OLD_SCM_PROMPT=1
|
|
$ cmd hg book -i
|
|
5cad84d17 (no-eol)
|
|
$ cmd hg book active
|
|
active (no-eol)
|
|
|
|
Test format string
|
|
$ oldcmd() {
|
|
> "$@"
|
|
> _dotfiles_scm_info "g g %s g g\n"
|
|
> }
|
|
$ hg init repo
|
|
$ oldcmd cd repo
|
|
g g empty g g
|
|
|
|
Test main prompt with no format string
|
|
$ _scm_prompt
|
|
(empty) (no-eol)
|