swh.loader.mercurial.hgutil module

swh.loader.mercurial.hgutil.repository(path: str) <module 'mercurial.localrepo' from '/home/jenkins/workspace/DDOC/publish/swh-docs/.tox/sphinx/lib/python3.7/site-packages/mercurial/localrepo.py'>[source]
class swh.loader.mercurial.hgutil.BranchingInfo(tips: Mapping[bytes, HgNodeId], bookmarks: Mapping[bytes, HgNodeId], open_heads: Mapping[bytes, List[HgNodeId]], closed_heads: Mapping[bytes, List[HgNodeId]], default_branch_alias: Union[bytes, NoneType])[source]

Bases: object

tips: Mapping[bytes, HgNodeId]

The first head of the branch, sorted by nodeid if there are multiple heads.

bookmarks: Mapping[bytes, HgNodeId]

all bookmarks in the repository (except local divergent ones)

open_heads: Mapping[bytes, List[HgNodeId]]

All open heads of a given branch, sorted by nodeid

closed_heads: Mapping[bytes, List[HgNodeId]]

All closed heads of a given branch, sorted by nodeid, if any

default_branch_alias: Optional[bytes]

The default snapshot branch to show in the UI

swh.loader.mercurial.hgutil.branching_info(repo: <module 'mercurial.localrepo' from '/home/jenkins/workspace/DDOC/publish/swh-docs/.tox/sphinx/lib/python3.7/site-packages/mercurial/localrepo.py'>, ignored: Set[int]) swh.loader.mercurial.hgutil.BranchingInfo[source]

Lists all relevant information about branch heads and bookmarks, grouped by type.

ignored: Revisions that we ignore during loading because they are corrupted or have a corrupted ancestor.

Categories may have overlapping nodes: a branch tip can be a closed branch head and have a bookmark on it, for example.

exception swh.loader.mercurial.hgutil.CloneTimeout[source]

Bases: Exception

exception swh.loader.mercurial.hgutil.CloneFailure[source]

Bases: Exception

swh.loader.mercurial.hgutil.clone(src: str, dest: str, timeout: float) None[source]

Clone a repository with timeout.

Parameters
  • src – clone source

  • dest – clone destination

  • timeout – timeout in seconds