git_handler: return gitlinks in get_files_changed

Currently, to figure out which gitlinks are in a repository we walk through the
entire tree. This patch lets us use get_files_changed to detect which gitlinks
have changed.
git_handler: move gparents initialization up to start of import_git_commit

gparents will be used to compute .hgsubstate in an upcoming patch.
git_handler: move check for gparents in repo to start of import_git_commit

Also drop Mercurial < 1.5 support.
git_handler: fix hgsubstate generation

Before this patch, in the git to hg conversion, .hgsubstate once created is
never deleted, even if no submodules are any longer present. This is broken
state, as shown by the test for which the SHA changes. Fix that by looking at
the diff instead of just what submodules are present.

Since 'gitlinks' now contains *changed* gitlinks, not *all* gitlinks, it no
longer makes sense to gate gitmodules checks on that.

This patch simply demonstrates that the test was broken; an upcoming patch will
introduce more tests.

Bonus: this also makes the import process faster because we no longer need to
walk the entire tree to collect gitlinks.

This will cause the SHAs of repos that have submodules added and then removed
to change.
test-git-submodules.t: add further tests

We now also test:
- removing one submodule but not all of them
- replacing a submodule with a file
- replacing a file with a submodule
git_handler: remove collect_gitlinks now that it is unused
hg2git: factor out remove path logic into a separate function

This will be used by _handle_subrepos in an upcoming patch.
hg2git: factor out subrepo parsing into a separate function

This code will be used in multiple contexts in an upcoming patch.
hg2git: add 'new' prefix to _handle_subrepos variables

An upcoming patch will introduce similar variables for self._ctx. This helps
disambiguate.
hg2git: make _handle_subrepos worked in the removed case

A test for this will be included in an upcoming patch.
hg2git: call _handle_subrepos when .hgsubstate is removed

Now that _handle_subrepos can handle .hgsubstate being removed, we should use
it for that.

The test changes make sure that the SHAs roundtrip.