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.24.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51ec48b3c19fb605beec7d45c76452f1e6e05ddbd62692d519cf6106f11568c0 |
|
MD5 | 917398cbcf093054bd40d02f55358fcd |
|
BLAKE2b-256 | 12b1fa412ee5bb9fe6d753131d96474258c8bb1194c70d197afdead46ab843ee |
Close
Hashes for swh.loader.mercurial-0.0.24-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2fd5013c4b88dc657a45ebb5afb1402f9eefd7e221913356b621bda196155b0 |
|
MD5 | a826f0be1dc65154981241a7925feb7c |
|
BLAKE2b-256 | db719964b2384f8e3223bfdc7b4b074c5a1757d6c1e3d73e7535832d9ddc0bb9 |