swh.loader.mercurial 3.6.2__py3-none-any.whl → 3.6.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2023 The Software Heritage developers
1
+ # Copyright (C) 2023 The Software Heritage developers
2
2
  # See the AUTHORS file at the top-level directory of this distribution
3
3
  # License: GNU General Public License version 3, or any later version
4
4
  # See top-level LICENSE file for more information
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2020-2023 The Software Heritage developers
1
+ # Copyright (C) 2020-2026 The Software Heritage developers
2
2
  # See the AUTHORS file at the top-level directory of this distribution
3
3
  # License: GNU General Public License version 3, or any later version
4
4
  # See top-level LICENSE file for more information
@@ -9,11 +9,13 @@ from functools import partial
9
9
  from typing import Dict, List, Mapping, NewType, Optional, Set
10
10
 
11
11
  # The internal Mercurial API is not guaranteed to be stable.
12
- from mercurial import bookmarks, context, error, hg, smartset, util
12
+ from mercurial import bookmarks, context, error, hg, initialization, smartset, util
13
13
  import mercurial.ui
14
14
 
15
15
  from swh.loader.core.utils import clone_with_timeout
16
16
 
17
+ initialization.init()
18
+
17
19
  NULLID = mercurial.node.nullid
18
20
  HgNodeId = NewType("HgNodeId", bytes)
19
21
  Repository = hg.localrepo
@@ -57,10 +59,11 @@ def branching_info(repo: hg.localrepo, ignored: Set[int]) -> BranchingInfo:
57
59
  branch_closed_heads = defaultdict(list)
58
60
  all_bookmarks = bookmarks.listbookmarks(repo)
59
61
 
60
- for branch_name, heads in repo.branchmap().items():
62
+ branchmap = repo.branchmap()
63
+ for branch_name in branchmap:
61
64
  # Sort the heads by node id since it's stable and doesn't depend on local
62
65
  # topology like cloning order.
63
- for head in sorted(heads):
66
+ for head in sorted(branchmap.branchheads(branch_name, closed=True)):
64
67
  head = repo[head]
65
68
  if head.rev() in ignored:
66
69
  # This revision or one of its ancestors is corrupted, ignore it
@@ -8,7 +8,7 @@ from pathlib import Path
8
8
 
9
9
  import pytest
10
10
 
11
- from swh.core.nar import Nar
11
+ from swh.core.nar import Nar, NarHashAlgo
12
12
  from swh.loader.exception import NotFound
13
13
  from swh.loader.mercurial.directory import HgCheckoutLoader, clone_repository
14
14
  from swh.loader.mercurial.hgutil import repository
@@ -22,7 +22,7 @@ from swh.model.hashutil import hash_to_bytes
22
22
 
23
23
 
24
24
  def compute_nar_hash_for_ref(
25
- repo_url: str, ref: str, hash_name: str = "sha256", temp_dir: str = "/tmp"
25
+ repo_url: str, ref: str, hash_name: NarHashAlgo = "sha256", temp_dir: str = "/tmp"
26
26
  ) -> str:
27
27
  """Compute the nar from a hg checked out by hg."""
28
28
  tmp_path = Path(os.path.join(temp_dir, "compute-nar"))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: swh.loader.mercurial
3
- Version: 3.6.2
3
+ Version: 3.6.3
4
4
  Summary: Software Heritage Mercurial Loader
5
5
  Author-email: Software Heritage developers <swh-devel@inria.fr>
6
6
  Project-URL: Homepage, https://gitlab.softwareheritage.org/swh/devel/swh-loader-mercurial
@@ -21,7 +21,7 @@ Requires-Dist: click
21
21
  Requires-Dist: patool
22
22
  Requires-Dist: python-dateutil
23
23
  Requires-Dist: python-hglib
24
- Requires-Dist: mercurial
24
+ Requires-Dist: mercurial>=7.2
25
25
  Requires-Dist: swh.model>=6.13.0
26
26
  Requires-Dist: swh.storage>=2.4.1
27
27
  Requires-Dist: swh.scheduler>=0.0.39
@@ -31,7 +31,7 @@ Requires-Dist: click; extra == "testing"
31
31
  Requires-Dist: patool; extra == "testing"
32
32
  Requires-Dist: python-dateutil; extra == "testing"
33
33
  Requires-Dist: python-hglib; extra == "testing"
34
- Requires-Dist: mercurial; extra == "testing"
34
+ Requires-Dist: mercurial>=7.2; extra == "testing"
35
35
  Requires-Dist: swh.model>=6.13.0; extra == "testing"
36
36
  Requires-Dist: swh.storage>=2.4.1; extra == "testing"
37
37
  Requires-Dist: swh.scheduler>=0.0.39; extra == "testing"
@@ -39,7 +39,7 @@ Requires-Dist: swh.loader.core>=5.24.0; extra == "testing"
39
39
  Requires-Dist: celery-types; extra == "testing"
40
40
  Requires-Dist: pytest; extra == "testing"
41
41
  Requires-Dist: pytest-mock; extra == "testing"
42
- Requires-Dist: swh.core[http]>=4.5.0; extra == "testing"
42
+ Requires-Dist: swh.core[http]>=4.5.3; extra == "testing"
43
43
  Requires-Dist: swh.loader.core[testing]>=5.24.0; extra == "testing"
44
44
  Requires-Dist: swh.scheduler[pytest]>=3.1.0; extra == "testing"
45
45
  Requires-Dist: swh.storage[pytest]>=3.1.0; extra == "testing"
@@ -1,8 +1,8 @@
1
1
  swh/loader/mercurial/__init__.py,sha256=ioPrVqbM_-w8sEwWUKEw9jCTbzQTkWwMaJM77D7YItM,745
2
2
  swh/loader/mercurial/archive_extract.py,sha256=gMSxvwIxZu5-Ei9a7ZeNCjZV-wBMIBTGonUutZ16yhE,1981
3
3
  swh/loader/mercurial/converters.py,sha256=qrL63I-6ezmICJa7cTB_jlS0kiPfHGL3xH8NXJTF1nU,1040
4
- swh/loader/mercurial/directory.py,sha256=UA5Hie6cSgGd21LE-QPPVE7aeiSzvpndzIMNULG7EUI,3354
5
- swh/loader/mercurial/hgutil.py,sha256=tg-QX2jRod9kUZ-nGPv30Km11Z1hTf4zINYL1T7eakk,5142
4
+ swh/loader/mercurial/directory.py,sha256=u0ZH6FWWeVUYkA6xlZLye2nCTFlC3GDjMgd-fiaGkFA,3355
5
+ swh/loader/mercurial/hgutil.py,sha256=GqpOCRNIZ-o6ruT-tYyV-E9xZVq4Km7vaRpzPDfUupY,5234
6
6
  swh/loader/mercurial/identify.py,sha256=9QQqI6MywQiZ62bm0JD_TNMjMlYdqJPzmHGFsl3cWGM,16604
7
7
  swh/loader/mercurial/loader.py,sha256=t2DFn75NfHLFWdEGhcQFe1f7c6as1CRxOYAqUu_1zRA,30036
8
8
  swh/loader/mercurial/py.typed,sha256=bWew9mHgMy8LqMu7RuqQXFXLBxh2CRx0dUbSx-3wE48,27
@@ -12,7 +12,7 @@ swh/loader/mercurial/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
12
12
  swh/loader/mercurial/tests/conftest.py,sha256=xMFVE0tp9bbspeywcIpS5gDjeZF_SMWcIgvyrsybuXQ,1671
13
13
  swh/loader/mercurial/tests/loader_checker.py,sha256=lcOoO4viwqfUgKKm9sUBhw5_uyS93pyT-BMWDnPxgzU,2353
14
14
  swh/loader/mercurial/tests/test_converters.py,sha256=5r02CYtZ85xdK00wcfDjmWJo1Qr4BHOYHtjxWaHOVhY,2155
15
- swh/loader/mercurial/tests/test_directory.py,sha256=rs-p4lRApMo4ayiTe-2z2HMnro4AOO_Pfj6WH1SGY8w,6861
15
+ swh/loader/mercurial/tests/test_directory.py,sha256=9EjAGcQvjpcb4lzJbMgEWiNrB5T1E5Lej2dNELI4fH8,6882
16
16
  swh/loader/mercurial/tests/test_identify.py,sha256=Dp21Ic8b8HMt3hcdqHzPuTpInTk4WLD-yjf7u79PJZM,3016
17
17
  swh/loader/mercurial/tests/test_loader.py,sha256=D4DdHTO_-zA6rK06b829mF1tl8Io3RJ9-H7WX2HTHCA,27002
18
18
  swh/loader/mercurial/tests/test_tasks.py,sha256=7vB4HSlmN7QKyA4p7ZnKRCmb4PgsY0qnW96KUJVjuzs,1970
@@ -33,10 +33,10 @@ swh/loader/mercurial/tests/data/the-sandbox.json,sha256=baIwB2DbiXkwzxoA0Z8vDFlt
33
33
  swh/loader/mercurial/tests/data/the-sandbox.tgz,sha256=MkJ6Nx_CDRkFlox9dcfq-I2ktFa2niAeAT2f7ClvrtY,13309
34
34
  swh/loader/mercurial/tests/data/transplant.json,sha256=h9akY1VS5nv5LOoiZuiJ3tg9ikkeciqdpjpeyGFR_p0,633
35
35
  swh/loader/mercurial/tests/data/transplant.tgz,sha256=eoS3hnKcIOkNrx3pj8lj3lMP7_V8EEjg4rmNI0qO1Vs,3206
36
- swh_loader_mercurial-3.6.2.dist-info/licenses/AUTHORS,sha256=CfkR1t8Z3y1NSRjmzMBmWzN55CEqCDCIXp1XtqzAjf4,117
37
- swh_loader_mercurial-3.6.2.dist-info/licenses/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
38
- swh_loader_mercurial-3.6.2.dist-info/METADATA,sha256=Jgd4h1TQfBSIXFfSVh3PdN3gAWmzcLxVZWwNeCTzEeY,3140
39
- swh_loader_mercurial-3.6.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
40
- swh_loader_mercurial-3.6.2.dist-info/entry_points.txt,sha256=KR1-Noi4WbxrdetuNh-QSOSVVp12_NT04aa5nK3YO5o,202
41
- swh_loader_mercurial-3.6.2.dist-info/top_level.txt,sha256=8XlamXOHbQHPR7Tn7kZa8F4ufiLuK-BL_bZje5MY9hw,4
42
- swh_loader_mercurial-3.6.2.dist-info/RECORD,,
36
+ swh_loader_mercurial-3.6.3.dist-info/licenses/AUTHORS,sha256=CfkR1t8Z3y1NSRjmzMBmWzN55CEqCDCIXp1XtqzAjf4,117
37
+ swh_loader_mercurial-3.6.3.dist-info/licenses/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
38
+ swh_loader_mercurial-3.6.3.dist-info/METADATA,sha256=JtybLPGwP5Hd0j7a85JYuNkJXMfCsVp4fg2QRtoFatM,3150
39
+ swh_loader_mercurial-3.6.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
40
+ swh_loader_mercurial-3.6.3.dist-info/entry_points.txt,sha256=KR1-Noi4WbxrdetuNh-QSOSVVp12_NT04aa5nK3YO5o,202
41
+ swh_loader_mercurial-3.6.3.dist-info/top_level.txt,sha256=8XlamXOHbQHPR7Tn7kZa8F4ufiLuK-BL_bZje5MY9hw,4
42
+ swh_loader_mercurial-3.6.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5