sapling/tests/test-githelp.t
Andi Ni 1d750a090b Githelp now throws error rather than crashes on unrecognized option packed with other options.
Summary: Bug fixed by enclosing raw array remove with try-except block.

Test Plan: Run /tests/run-tests.py . It should finish without errors.

Reviewers: rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, sigmix

Differential Revision: https://phabricator.fb.com/D1927784

Tasks: 6463098

Signature: t1:1927784:1426810833:b9a549d41eaaa55c420b480018298b725cc69aaf
2015-03-19 11:05:02 -07:00

32 lines
894 B
Perl

$ extpath=$(dirname $TESTDIR)
$ cp $extpath/githelp.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]
> githelp=$TESTTMP/githelp.py
> EOF
$ hg init repo
$ cd repo
githelp on a single command should succeed
$ hg githelp -- commit
hg commit
githelp on a command with options should succeed
$ hg githelp -- commit -pm "abc"
hg record -m 'abc'
githelp on a command with standalone unrecognized option should succeed with warning
$ hg githelp -- commit -p -v
ignoring unknown option -v
hg record
githelp on a command with unrecognized option packed with other options should fail with error
$ hg githelp -- commit -pv
abort: unknown option v packed with other options
Please try passing the option as it's own flag: -v
If this is a valid git command, please log a task for the source_control oncall.
[255]