diff --git a/requirements-swh.txt b/requirements-swh.txt --- a/requirements-swh.txt +++ b/requirements-swh.txt @@ -1,4 +1,4 @@ swh.model >= 0.0.27 swh.storage >= 0.0.114 swh.scheduler >= 0.0.39 -swh.loader.core >= 0.0.37 +swh.loader.core >= 0.0.43 diff --git a/swh/loader/mercurial/loader.py b/swh/loader/mercurial/loader.py --- a/swh/loader/mercurial/loader.py +++ b/swh/loader/mercurial/loader.py @@ -285,7 +285,7 @@ content, log=self.log, max_content_size=self.content_max_size_limit, - origin_id=self.origin_id + origin_url=self.origin['url'] ) def load_directories(self): diff --git a/swh/loader/mercurial/tests/test_loader.py b/swh/loader/mercurial/tests/test_loader.py --- a/swh/loader/mercurial/tests/test_loader.py +++ b/swh/loader/mercurial/tests/test_loader.py @@ -8,6 +8,8 @@ from unittest.mock import patch from swh.loader.core.tests import BaseLoaderTest +from swh.storage.algos.snapshot import snapshot_get_all_branches + from .common import HgLoaderMemoryStorage, HgArchiveLoaderMemoryStorage @@ -265,10 +267,12 @@ directory=self.destination_path) # collect swh revisions - origin_id = self.storage.origin_get([ - {'type': 'hg', 'url': self.repo_url}])[0]['id'] - snapshot = self.storage.snapshot_get_latest(origin_id) + origin_url = self.storage.origin_get([ + {'type': 'hg', 'url': self.repo_url}])[0]['url'] + visit = self.storage.origin_visit_get_latest( + origin_url, require_snapshot=True) revisions = [] + snapshot = snapshot_get_all_branches(self.storage, visit['snapshot']) for branch in snapshot['branches'].values(): if branch['target_type'] != 'revision': continue