git-cvsimport-3: extract main as a method

This is the first step to making it easier to debug the script using a
Python REPL.

Signed-off-by: John Keeping <john@keeping.me.uk>
git-cvsimport-3: remove a redundant version check

We already check the Python version at the top of the script, so doing
it again in main() is unnecessary.

Signed-off-by: John Keeping <john@keeping.me.uk>
git-cvsimport-3: don't quit when filesource is requested

Signed-off-by: John Keeping <john@keeping.me.uk>
git-cvsimport-3: extract error handler from main()

This will allow us to handle errors during option parsing by simply
raising an exception, and removes a layer of indentation.

Also change the error from "git_cvsimport" to "git cvsimport".

The patch is much clearer with 'git diff -b'.

Signed-off-by: John Keeping <john@keeping.me.uk>
git-cvsimport-3: use Fatal consistently

Instead of doing "sys.stderr.write(...); sys.exit(1)", raise a Fatal
exception when a fatal error occurs.  This change means that we can
remove the "git cvsimport: " prefix from all fatal error messages since
it is added by the top-level exception handler when printing the message
from a Fatal exception.

Signed-off-by: John Keeping <john@keeping.me.uk>
git-cvsimport-3: handle the backend option first

Most of the options to git-cvsimport-3 are simply passed to the backend,
this means the if the '-e <backend>' option does not occur first any
options preceding it will effectively be ignored.

Extract the '-e' option handling as a special case before the main
option handling loop to avoid this issue.

Signed-off-by: John Keeping <john@keeping.me.uk>