diff --git a/README.md b/README.md index 6c3139b..887b797 100644 --- a/README.md +++ b/README.md @@ -1,82 +1,83 @@ swh-loader-mercurial ========================= # Configuration file In usual location for a loader, *{/etc/softwareheritage/ | ~/.swh/ | ~/.config/swh/}loader/hg.yml*: ``` YAML storage: cls: remote args: url: http://localhost:5002/ send_contents: True send_directories: True send_revisions: True send_releases: True send_occurrences: True content_packet_size: 1000 content_packet_size_bytes: 1073741824 directory_packet_size: 2500 revision_packet_size: 1000 release_packet_size: 1000 occurrence_packet_size: 1000 ``` # Basic use From python3's toplevel: +## Remote (failure) + +``` Python +# remote repository +origin_url = 'https://www.mercurial-scm.org/repo/hello' +# local clone +directory = '/home/storage/hg/repo/hello' + +import logging +logging.basicConfig(level=logging.DEBUG) + +from swh.loader.mercurial.tasks import LoadMercurialTsk + +t = LoadMercurialTsk() +t.run(origin_url=origin_url, directory=directory, visit_date='2016-05-03T15:16:32+00:00') +``` + ## local directory (failure) -Only origin and contents are filled. +Only origin, contents, and directories are filled so far. -Remaining objects are empty (directory, revision, release, -occurrence). +Remaining objects are empty (revision, release, occurrence). ``` Python project = '756015-ipv6' directory = '/home/storage/hg/repo/%s' % project origin_url = 'https://%s.googlecode.com' % project import logging logging.basicConfig(level=logging.DEBUG) from swh.loader.mercurial.tasks import SlowLoadMercurialTsk t = SlowLoadMercurialTsk() t.run(origin_url=origin_url, directory=directory, visit_date='2016-05-03T15:16:32+00:00') ``` -## local archive +## local archive (failure) ``` Python project = '756015-ipv6-source-archive.zip' archive_path = '/home/storage/hg/repo/%s' % project origin_url = 'https://%s-archive.googlecode.com' % project import logging logging.basicConfig(level=logging.DEBUG) from swh.loader.mercurial.tasks import SlowLoadMercurialArchiveTsk t = SlowLoadMercurialArchiveTsk() t.run(origin_url=origin_url, archive_path=archive_path, visit_date='2016-05-03T15:16:32+00:00') ``` - -## Remote (failure) - -``` Python -origin_url = 'https://code.launchpad.net/~bzr-svn/bzr-svn/1.2' -directory = '/tmp/' - -import logging -logging.basicConfig(level=logging.DEBUG) - -from swh.loader.mercurial.tasks import LoadMercurialTsk - -t = LoadMercurialTsk() -t.run(origin_url=origin_url, directory=directory, visit_date='2016-05-03T15:16:32+00:00') -```