From 915ac41ada34c55f7674a00a2c366cdc5d35b264 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 27 Mar 2020 15:26:47 +0100 Subject: scripts: myhtml.py: Fix links to commits in linux-next HTML links to commits in linux-next are broken, as they refer to the wrong repository. Consolidate bsp_url() and upstream_url() into commit_url(), and use the correct repository for commits in linux-next. This avoids duplication, and makes it easier to add new URL types later. Signed-off-by: Geert Uytterhoeven Acked-by: Kuninori Morimoto --- scripts/myhtml.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/myhtml.py b/scripts/myhtml.py index 114d5a4..39ea0e1 100755 --- a/scripts/myhtml.py +++ b/scripts/myhtml.py @@ -129,11 +129,14 @@ class periject_html(base.base): def git_title(self, id): return self.run("git -C {} log -1 {} --format=%s".format(self.git, id)) - def bsp_url(self, id): - return "https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git/commit/?id={}".format(id) - - def upstream_url(self, id): - return "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id={}".format(id) + def commit_url(self, id, type): + if (type == "bsp"): + return "https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git/commit/?id={}".format(id) + if (type == "torvalds"): + return "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id={}".format(id) + if (type == "next"): + return "https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id={}".format(id) + return id; #-------------------- # print_css @@ -494,7 +497,7 @@ class periject_html(base.base): with html("ul"): for bsp in bsp_list: cnt += 1 - html("li").print(html("a", {"href":self.bsp_url(bsp), + html("li").print(html("a", {"href":self.commit_url(bsp, "bsp"), "target":"subbody"}).text(self.git_title(bsp))) return cnt @@ -510,7 +513,7 @@ class periject_html(base.base): with html("tr"): html("th").print(item) - html("td").print(html("a", {"href":self.upstream_url(commit), + html("td").print(html("a", {"href":self.commit_url(commit, item), "target":"subbody"}).text(self.git_title(commit))) return 1 -- cgit v1.2.3