Bitbucket: don't fail on PRs with unknown target
Again on PyPy, got this case in which we miss the target:
Bitbucket PR importer for pypy-2020-01-16/pypy Import failed for PR iid 638, error Could not find changeset 2bc8bf236aa7 in /var/opt/gitlab/git-data/repositories/pypy-2020-01-16/pypy.hg, trace: /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/git/repository.rb:569:in `hgsha_from_rev'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/bitbucket_import/importer.rb:210:in `block in import_pull_requests'
and currently my line 210 is:
root@testpypy:/opt/gitlab/embedded/service/gitlab-rails# cat -n lib/gitlab/bitbucket_import/importer.rb | grep -E '^\s*210'
210 target_hgsha = raw_repo.hgsha_from_rev(pull_request.target_branch_sha)
Obviously that is a rare condition, but it could happen, e.g., if the target branch head used to be a draft at the time of submission and is obsolete at the time of import, meaning that we didn't get it from our pull.
It's less clear what to do than with #166 (closed): just taking the branch head as target? Would that be relevant for older PRs? That one isn't old and is even still open at the time of this writing.