Changeset View
Changeset View
Standalone View
Standalone View
swh/web/common/converters.py
Show First 20 Lines • Show All 340 Lines • ▼ Show 20 Lines | if sv and 'branches' in sv: | ||||
sv['branches'] = { | sv['branches'] = { | ||||
decode_with_escape(k): v | decode_with_escape(k): v | ||||
for k, v in sv['branches'].items() | for k, v in sv['branches'].items() | ||||
} | } | ||||
for k, v in snapshot['branches'].items(): | for k, v in snapshot['branches'].items(): | ||||
# alias target existing branch names, not a sha1 | # alias target existing branch names, not a sha1 | ||||
if v and v['target_type'] == 'alias': | if v and v['target_type'] == 'alias': | ||||
branch = decode_with_escape(k) | branch = decode_with_escape(k) | ||||
target = v['target'].decode('utf-8') | target = decode_with_escape(v['target']) | ||||
sv['branches'][branch]['target'] = target | sv['branches'][branch]['target'] = target | ||||
return sv | return sv | ||||
def from_directory_entry(dir_entry): | def from_directory_entry(dir_entry): | ||||
"""Convert swh person to serializable person dictionary. | """Convert swh person to serializable person dictionary. | ||||
Show All 17 Lines |