Add a new facility to permit rich history to be preserved across
reimports (when using "git ubuntu import --reimport"). Previous rich
history is exported to a temporary directory prior to the reimport.
During import, the rich history importer is then given the opportunity
to reconstruct an upload tag "just in time" before it is used.
Testing the importer end-to-end for this is not currently practical
since we have no tests for the --reimport function at all. We have
pragmatically concluded that it is sufficient to functionally test the
new rich history code, since --reimport will generally only be used with
manual supervision and the likely bugs in the importer code itself are
that rich history preservation won't work at all, or the importer will
fail entirely, and so will be easily noticed.
I have also added some limited additional tests to bring coverage of the
new gitubuntu.rich_history up to 100%.
The specification requires that we consider Debian and Ubuntu
publications in Launchpad simultaneously, ordering by date_created
across them both. This implements this requirement with
interleave_launchpad_versions_published_after() to wrap multiple calls
of launchpad_versions_published_after() and interleaving the results as
they are returned. The caller is adjusted to use this instead of
iterating over the two distributions separately.
Do not raise an exception if there are no items to return. Instead, make
it the caller's responsibility to handle an empty result. This makes it
easier for the caller to handle this case.
Instead of relying on only_debian as returned from
launchpad_versions_published_after(), instead determine whether the
Launchpad HEAD should be pointing at Ubuntu or Debian by looking to see
if we have a local Ubuntu head.
This removes an entanglement with launchpad_versions_published_after(),
making for easier future refactoring.
git-ubuntu clone uses the 'https' protocol by default, but provides a
--proto CLI option for the user to select other options. The allowed
options are 'git', 'http', and 'https'.
This patch adds 'git+ssh' as another allowed option. Manual testing
shows it works as expected with git ubuntu, with no further
configuration required.
N.b. there are other protocols permitted by git, such as 'ssh', 'ftp',
and local. These may require additional configuration work to set up,
so are omitted for now until use cases are identified.