Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/git/from_disk.py
Show First 20 Lines • Show All 222 Lines • ▼ Show 20 Lines | def get_snapshot(self): | ||||
if obj: | if obj: | ||||
branches[ref] = { | branches[ref] = { | ||||
'target': hashutil.bytehex_to_hash(target), | 'target': hashutil.bytehex_to_hash(target), | ||||
'target_type': converters.DULWICH_TYPES[obj.type_name], | 'target_type': converters.DULWICH_TYPES[obj.type_name], | ||||
} | } | ||||
else: | else: | ||||
branches[ref] = None | branches[ref] = None | ||||
for ref, target in self.repo.refs.get_symrefs().items(): | |||||
branches[ref] = { | |||||
'target': target, | |||||
'target_type': 'alias', | |||||
} | |||||
self.snapshot = converters.branches_to_snapshot(branches) | self.snapshot = converters.branches_to_snapshot(branches) | ||||
return self.snapshot | return self.snapshot | ||||
def get_fetch_history_result(self): | def get_fetch_history_result(self): | ||||
"""Return the data to store in fetch_history for the current loader""" | """Return the data to store in fetch_history for the current loader""" | ||||
return { | return { | ||||
'contents': len(self.type_to_ids[b'blob']), | 'contents': len(self.type_to_ids[b'blob']), | ||||
'directories': len(self.type_to_ids[b'tree']), | 'directories': len(self.type_to_ids[b'tree']), | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |