sapling/eden/scm/tests/test-commit-reuse.t
Muir Manders 1dcb7966fc tests: turn on eagerepo for a bunch of tests
Summary: These are the tests that passed after adding "$ eagerepo". I attempted to turn on eagerepo for all tests that didn't contain "$ eagerepo" or "configure modern".

Reviewed By: quark-zju

Differential Revision: D44445379

fbshipit-source-id: b283be6d5249f74e11a3205622961e457587e93b
2023-04-04 08:42:03 -07:00

51 lines
1.1 KiB
Perl

#chg-compatible
#debugruntest-compatible
$ eagerepo
Test the flag to reuse another commit's message (-M):
$ newrepo
$ drawdag << 'EOS'
> B
> |
> A
> EOS
$ hg up -Cq $B
$ touch afile
$ hg add afile
$ hg commit -M $B
$ tglog
@ 1c3d011e7c74 'B'
o 112478962961 'B'
o 426bada5c675 'A'
Ensure it's incompatible with other flags:
$ echo 'canada rocks, eh?' > afile
$ hg commit -M . -m 'this command will fail'
abort: --reuse-message and --message are mutually exclusive
[255]
$ echo 'Super duper commit message' > ../commitmessagefile
$ hg commit -M . -l ../commitmessagefile
abort: --reuse-message and --logfile are mutually exclusive
[255]
Ensure it supports nonexistant revisions:
$ hg commit -M thisrevsetdoesnotexist
abort: unknown revision 'thisrevsetdoesnotexist'!
[255]
Ensure it populates the message editor:
$ HGEDITOR=cat hg commit -M . -e
B
HG: Enter commit message. Lines beginning with 'HG:' are removed.
HG: Leave message empty to abort commit.
HG: --
HG: user: test
HG: branch 'default'
HG: changed afile