Page MenuHomeSoftware Heritage

D3223.diff
No OneTemporary

D3223.diff

diff --git a/swh/web/browse/utils.py b/swh/web/browse/utils.py
--- a/swh/web/browse/utils.py
+++ b/swh/web/browse/utils.py
@@ -333,7 +333,10 @@
if snapshot_context["release"]:
query_params["release"] = snapshot_context["release"]
- elif snapshot_context["branch"] and snapshot_context["branch"] != "HEAD":
+ elif snapshot_context["branch"] and snapshot_context["branch"] not in (
+ "HEAD",
+ snapshot_context["revision_id"],
+ ):
query_params["branch"] = snapshot_context["branch"]
elif snapshot_context["revision_id"]:
query_params["revision"] = snapshot_context["revision_id"]
diff --git a/swh/web/browse/views/revision.py b/swh/web/browse/views/revision.py
--- a/swh/web/browse/views/revision.py
+++ b/swh/web/browse/views/revision.py
@@ -342,7 +342,7 @@
visit_id=visit_id,
branch_name=request.GET.get("branch"),
release_name=request.GET.get("release"),
- revision_id=request.GET.get("revision"),
+ revision_id=sha1_git,
)
except NotFoundExc as e:
raw_rev_url = reverse(
diff --git a/swh/web/tests/browse/views/test_revision.py b/swh/web/tests/browse/views/test_revision.py
--- a/swh/web/tests/browse/views/test_revision.py
+++ b/swh/web/tests/browse/views/test_revision.py
@@ -3,6 +3,7 @@
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
+import random
import textwrap
from django.utils.html import escape
@@ -31,6 +32,9 @@
client, archive_data, revision, origin_url=origin["url"], snapshot=snapshot,
)
+ revision = random.choice(archive_data.revision_log(revision))["id"]
+ _revision_browse_checks(client, archive_data, revision, origin_url=origin["url"])
+
@given(revision())
def test_revision_log_browse(client, archive_data, revision):

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 18, 2:28 AM (1 d, 22 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3220140

Event Timeline