Changeset View
Changeset View
Standalone View
Standalone View
swh/web/ui/backend.py
Show First 20 Lines • Show All 190 Lines • ▼ Show 20 Lines | Args: | ||||
origin_id: origin of the revision | origin_id: origin of the revision | ||||
- branch_name: revision's branch. | - branch_name: revision's branch. | ||||
- timestamp: revision's time frame. | - timestamp: revision's time frame. | ||||
Returns: | Returns: | ||||
Information for the revision matching the criterions. | Information for the revision matching the criterions. | ||||
""" | """ | ||||
# Disable pending RemoteStorage opening revision_log_by | |||||
""" | |||||
if not ts and branch_name == 'refs/heads/master': | |||||
return main.storage().revision_log_by(origin_id) | |||||
""" | |||||
rev = main.storage().revision_get_by(origin_id, | return main.storage().revision_log_by(origin_id, | ||||
branch_name, | branch_name, | ||||
timestamp=ts, | ts) | ||||
limit=1) | |||||
if not rev: | |||||
return None | |||||
rev_sha1s_bin = [revision['id'] for revision in rev] | |||||
return main.storage().revision_log(rev_sha1s_bin, limit) | |||||
def stat_counters(): | def stat_counters(): | ||||
"""Return the stat counters for Software Heritage | """Return the stat counters for Software Heritage | ||||
Returns: | Returns: | ||||
A dict mapping textual labels to integer values. | A dict mapping textual labels to integer values. | ||||
""" | """ | ||||
Show All 32 Lines |