Page MenuHomeSoftware Heritage

D55.id187.diff
No OneTemporary

D55.id187.diff

diff --git a/swh/web/ui/backend.py b/swh/web/ui/backend.py
--- a/swh/web/ui/backend.py
+++ b/swh/web/ui/backend.py
@@ -196,21 +196,10 @@
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,
- branch_name,
- timestamp=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)
+ return main.storage().revision_log_by(origin_id,
+ branch_name,
+ ts)
def stat_counters():
diff --git a/swh/web/ui/templates/upload_and_search.html b/swh/web/ui/templates/upload_and_search.html
--- a/swh/web/ui/templates/upload_and_search.html
+++ b/swh/web/ui/templates/upload_and_search.html
@@ -49,13 +49,13 @@
value=""
style="display:none"
placeholder="File(s) to upload, hash and search for SHA-1 or SHA-256 checksum" />
- {% if search_stats is not none and search_stats %}
- <label id="stats">
- Files available in SWH: {{ '%.2f' | format(search_stats['pct']) }}% of
- {{ search_stats['nbfiles'] }} files.
- </label>
- {% endif %}
{% if search_res is not none %}
+ {% if search_stats is not none %}
+ <label id="stats">
+ Files available in SWH: {{ '%.2f' | format(search_stats['pct']) }}% of
+ {{ search_stats['nbfiles'] }} files.
+ </label>
+ {% endif %}
<table id="results" class="table table-striped">
<thead class="thead-default">
<th>File name</th>
@@ -80,12 +80,8 @@
{% endfor %}
</table>
{% endif %}
- {% if messages is not none and messages %}
- <div id="messages" class="row">
- {% for message in messages %}
- <br />
+ {% if message is not none %}
<div class="span8">{{ message | safe }}</div>
- {% endfor %}
</div>
{% endif %}
<!-- jQuery setup -->
diff --git a/swh/web/ui/tests/test_backend.py b/swh/web/ui/tests/test_backend.py
--- a/swh/web/ui/tests/test_backend.py
+++ b/swh/web/ui/tests/test_backend.py
@@ -456,7 +456,6 @@
@istest
def revision_log_by(self):
# given
- # given
sha1_bin = hashutil.hex_to_hash(
'28d8be353ed3480476f032475e7c233eff7371d5')
stub_revision_log = [{
@@ -482,9 +481,8 @@
'metadata': [],
}]
- self.storage.revision_get_by = MagicMock(return_value=[
- {'id': sha1_bin}])
- self.storage.revision_log = MagicMock(return_value=stub_revision_log)
+ self.storage.revision_log_by = MagicMock(
+ return_value=stub_revision_log)
# when
actual_log = backend.revision_log_by(1, 'refs/heads/master', None)
@@ -496,11 +494,10 @@
@istest
def revision_log_by_norev(self):
# given
- # given
sha1_bin = hashutil.hex_to_hash(
'28d8be353ed3480476f032475e7c233eff7371d5')
- self.storage.revision_get_by = MagicMock(return_value=None)
+ self.storage.revision_log_by = MagicMock(return_value=None)
# when
actual_log = backend.revision_log_by(1, 'refs/heads/master', None)

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 3, 3:48 PM (2 w, 11 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3227261

Event Timeline