Software Heritage Mercurial Loader
Project description
swh-loader-mercurial
Configuration file
In usual location for a loader, {/etc/softwareheritage/ | ~/.swh/ | ~/.config/swh/}loader/hg.yml:
storage:
cls: remote
args:
url: http://localhost:5002/
Basic use
The main entry point to import a Mercurial repository is the main
function
defined in the swh.loader.mercurial.cli
module:
python3 -m swh.loader.mercurial.cli
If the Python package has been installed via pip
, you should be able
to type:
user@host:~$ swh-loader-hg --help
Usage: swh-loader-hg [OPTIONS] ORIGIN_URL
Options:
-d, --hg-directory TEXT Path to the hg (local) directory to load
from. If unset, the hg repo will ben cloned
from the given (origin) url
-a, --hg-archive TEXT Path to the hg (local) archive file to load
from.
-D, --visit-date TEXT Visit date (defaults to now)
-l, --log-level [NOTSET|DEBUG|INFO|WARNING|ERROR|CRITICAL]
Log level
--help Show this message and exit.
For example:
user@host:~$ swh-loader-hg https://www.mercurial-scm.org/repo/hello
[...]
From Python
From python3's toplevel:
Remote
project = 'hello'
# remote repository
origin_url = 'https://www.mercurial-scm.org/repo/%s' % project
# local clone
directory = '/home/storage/hg/repo/%s' % project
import logging
logging.basicConfig(level=logging.DEBUG)
from swh.loader.mercurial.tasks import LoadMercurial
t = LoadMercurial()
t.run(origin_url=origin_url, directory=directory, visit_date='2016-05-03T15:16:32+00:00')
local directory
Only origin, contents, and directories are filled so far.
Remaining objects are empty (revision, release, occurrence).
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 LoadMercurial
t = LoadMercurial()
t.run(origin_url=origin_url, directory=directory, visit_date='2016-05-03T15:16:32+00:00')
local archive
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 LoadArchiveMercurial
t = LoadArchiveMercurial()
t.run(origin_url=origin_url, archive_path=archive_path, visit_date='2016-05-03T15:16:32+00:00')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for swh.loader.mercurial-0.0.32.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b35c7558ca4111de7b5e63e3535f4fdc7d609aae257e69b932739609c162cc05 |
|
MD5 | 83d7f34e1217fba5a8a55ef1a5497011 |
|
BLAKE2b-256 | 4afcf94e43e035d69c6961500b29a89b43a5d8dfa52e3ec64dc9dd2b0cac9463 |
Close
Hashes for swh.loader.mercurial-0.0.32-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e90a7704bdc0f54640abee4b0857134d68f529005481dca7c60a65e7d385eb29 |
|
MD5 | d9044383d1ed40a9679d0b3c07d6df9e |
|
BLAKE2b-256 | d994f24d377c9f4dd19132e927363680a19e573f0f9383bb470e8aa0ef2d4aaa |