sapling/tests/test-fb-hgext-p4fastimport-sanitize-opts.t
Alexandre Marin 1d63473120 Sanitize opts
Summary:
This change:
Moves some opts sanitizing logic into function `sanitizeopts`
Adds checks for `limit` being a positive integer
Uses `sanitizeopts` new function in p4seqimport
Adds a test covering `sanitizeopts`

For a high-level overview of p4seqimport, please check https://our.intern.facebook.com/intern/wiki/IDI/p4seqimport/

Differential Revision: D7035217

fbshipit-source-id: cd677fb254ff83d123673d51a1c682639de08a30
2018-04-13 21:51:43 -07:00

25 lines
536 B
Perl

#require p4
$ . $TESTDIR/p4setup.sh
$ cd $hgwd
$ hg init --config 'format.usefncache=False'
Verifies limit is a positive integer
$ hg p4seqimport --limit -10 -P $P4ROOT $P4CLIENT
abort: --limit should be > 0, got -10
[255]
$ hg p4seqimport --limit foo -P $P4ROOT $P4CLIENT
abort: --limit should be an integer, got foo
[255]
Ensures --base requests bookmark to be provided
$ hg p4seqimport --base 10 -P $P4ROOT $P4CLIENT
abort: must set --bookmark when using --base
[255]
End Test
stopping the p4 server