Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/mercurial/hgutil.py
Show All 29 Lines | def repository(path: str) -> hg.localrepo: | ||||
ui = mercurial.ui.ui.load() | ui = mercurial.ui.ui.load() | ||||
return hg.repository(ui, path.encode()) | return hg.repository(ui, path.encode()) | ||||
def branches(repo: hg.localrepo) -> Dict[bytes, HgNodeId]: | def branches(repo: hg.localrepo) -> Dict[bytes, HgNodeId]: | ||||
"""List repository named branches and their tip node.""" | """List repository named branches and their tip node.""" | ||||
result = {} | result = {} | ||||
for tag, heads, tip, isclosed in repo.branchmap().iterbranches(): | for tag, heads, tip, isclosed in repo.branchmap().iterbranches(): | ||||
if isclosed: | |||||
continue | |||||
result[tag] = tip | result[tag] = tip | ||||
return result | return result | ||||
class CloneTimeout(Exception): | class CloneTimeout(Exception): | ||||
pass | pass | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |