summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2020-03-27 15:26:47 +0100
committerGeert Uytterhoeven <geert+renesas@glider.be>2020-03-30 21:02:32 +0200
commit915ac41ada34c55f7674a00a2c366cdc5d35b264 (patch)
tree16e561823a98e82773075b83fca50dc353413fac /scripts
parentd0d7223a536dd8aec32e90e96b8126a73a09d8fd (diff)
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 <geert+renesas@glider.be> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/myhtml.py17
1 files 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