Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/mercurial/hgutil.py
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | for branch, heads in branch_open_heads.items(): | ||||
branches_with_one_head.add(branch) | branches_with_one_head.add(branch) | ||||
# The most common case is one head per branch. Simplifying this means we have | # The most common case is one head per branch. Simplifying this means we have | ||||
# less duplicate data, because open heads are the same as open branch tips. | # less duplicate data, because open heads are the same as open branch tips. | ||||
# We don't do more complex deduplication, this is just a simple optimization. | # We don't do more complex deduplication, this is just a simple optimization. | ||||
for branch in branches_with_one_head: | for branch in branches_with_one_head: | ||||
del branch_open_heads[branch] | del branch_open_heads[branch] | ||||
# for bookmarks, the ids listed are not aligned with the rest, it's human | |||||
# readable id as bytes string instead of bytes string. Hence the extra mapping. | |||||
branch_bookmarks = { | |||||
branch: HgNodeId(bytes.fromhex(node_id.decode())) | |||||
for branch, node_id in all_bookmarks.items() | |||||
} | |||||
return BranchingInfo( | return BranchingInfo( | ||||
tips=branch_tips, | tips=branch_tips, | ||||
bookmarks=all_bookmarks, | bookmarks=branch_bookmarks, | ||||
open_heads=branch_open_heads, | open_heads=branch_open_heads, | ||||
closed_heads=branch_closed_heads, | closed_heads=branch_closed_heads, | ||||
default_branch_alias=default_rev_alias, | default_branch_alias=default_rev_alias, | ||||
) | ) | ||||
class CloneTimeout(Exception): | class CloneTimeout(Exception): | ||||
pass | pass | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |