Skip to content

mercurial.cli: Deprecate cli in favor of the generic `swh loader run`

This module is:

  • not referenced in the setup.py (so no simple cli call)
  • not tested
  • using an in-memory storage
  • no longer the canonical way of triggering a mercurial ingestion

Note that this also fixes the visit date cli input. When user provided, this date should be parsed as a datetime prior to being passed to the loader constructor.

Test Plan

tox for no-regression purpose

and manual run for the actual cli.

$ python3 -m swh.loader.mercurial.cli --visit-date "2016-05-03 15:16:32+00" https://www.mercurial-scm.org/repo/hello
/home/tony/.virtualenvs/swh/lib/python3.7/site-packages/click/core.py:610: DeprecationWarning: Call to deprecated function (or staticmethod) main. (Use `swh loader run mercurial|mercurial_from_disk instead`) -- Deprecated since version 0.4.0.
  return callback(*args, **kwargs)
2021-02-25 10:02:07,775 8487 Load origin 'https://www.mercurial-scm.org/repo/hello' with type 'hg'
2021-02-25 10:02:07,775 8487 Cloning https://www.mercurial-scm.org/repo/hello to /tmp/swh.loader.mercurial.6gndrj0z-8487 with timeout 7200 seconds
2021-02-25 10:02:09,626 8487 Bundling at /tmp/swh.loader.mercurial.6gndrj0z-8487/HG20_none_bundle
2021-02-25 10:02:09,775 8487 Cleanup up working bundle /tmp/swh.loader.mercurial.6gndrj0z-8487/HG20_none_bundle
2021-02-25 10:02:09,775 8487 Cleanup up working directory /tmp/swh.loader.mercurial.6gndrj0z-8487

Migrated from D5138 (view on Phabricator)

Merge request reports