From 2c55b65e1f77cc6bbb11556e10fd90bfeb3442e1 Mon Sep 17 00:00:00 2001 From: zPlus Date: Sun, 31 Jul 2022 17:18:01 +0200 Subject: [PATCH] Fix broken branch selectors in "tree" and "log" pages. - Select the correct revision in the {% for h in heads %} {% endfor %} @@ -18,7 +19,8 @@ {% for t in tags %} {% endfor %} diff --git a/templates/repository/tree.html b/templates/repository/tree.html index 7679756..8a9063d 100644 --- a/templates/repository/tree.html +++ b/templates/repository/tree.html @@ -10,7 +10,8 @@ {% for h in heads %} {% endfor %} @@ -18,7 +19,8 @@ {% for t in tags %} {% endfor %} diff --git a/web.py b/web.py index eb81bac..719bde6 100644 --- a/web.py +++ b/web.py @@ -398,7 +398,7 @@ def tree(repository, revision, tree_path=None): def tree_change(repository): """ Switch revision in tree page. - This route is used by the
in the "tree page when changing the revision + This route is used by the in the tree page when changing the revision to be displayed. """ @@ -474,6 +474,20 @@ def log(repository, revision): commits=commits, repository=repository, revision=revision) +@bottle.post('/.git/log', name='log_change') +def log_change(repository): + """ + Switch revision in log page. + This route is used by the in the log page when changing the revision + to be displayed. + """ + + revision = request.forms.get('revision') + + bottle.redirect(application.get_url('log', + repository=repository, + revision=revision)) + @bottle.get('/.git/raw//', name='raw') def raw(repository, revision, tree_path): """