Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/mercurial/loader.py
Show First 20 Lines • Show All 370 Lines • ▼ Show 20 Lines | def get_revisions(self): | ||||
directory_id = self.mnode_to_tree_id[commit['manifest']] | directory_id = self.mnode_to_tree_id[commit['manifest']] | ||||
extra_meta = [] | extra_meta = [] | ||||
extra = commit.get('extra') | extra = commit.get('extra') | ||||
if extra: | if extra: | ||||
for e in extra.split(b'\x00'): | for e in extra.split(b'\x00'): | ||||
k, v = e.split(b':', 1) | k, v = e.split(b':', 1) | ||||
k = k.decode('utf-8') | k = k.decode('utf-8') | ||||
# transplant_source stores binary reference to a changeset | |||||
# prefer to dump hexadecimal one in the revision metadata | |||||
if k == 'transplant_source': | |||||
v = hash_to_hex(v) | |||||
extra_meta.append([k, v]) | extra_meta.append([k, v]) | ||||
revision = { | revision = { | ||||
'author': author_dict, | 'author': author_dict, | ||||
'date': date_dict, | 'date': date_dict, | ||||
'committer': author_dict, | 'committer': author_dict, | ||||
'committer_date': date_dict, | 'committer_date': date_dict, | ||||
'type': 'hg', | 'type': 'hg', | ||||
▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines |