diff options
Diffstat (limited to 'scripts/myhtml.py')
-rwxr-xr-x | scripts/myhtml.py | 49 |
1 files changed, 38 insertions, 11 deletions
diff --git a/scripts/myhtml.py b/scripts/myhtml.py index 114d5a4..e46b65e 100755 --- a/scripts/myhtml.py +++ b/scripts/myhtml.py @@ -129,11 +129,16 @@ 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://github.com/renesas-rcar/linux-bsp/commit/{}?diff=unified".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) + if (type == "lore"): + return "https://lore.kernel.org/r/{}".format(id) + return id; #-------------------- # print_css @@ -494,8 +499,8 @@ 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), - "target":"subbody"}).text(self.git_title(bsp))) + html("li").print(html("a", {"href":self.commit_url(bsp, "bsp"), + "target":"_blank"}).text(self.git_title(bsp))) return cnt @@ -510,12 +515,28 @@ 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 #-------------------- + # __task_commit_posted + #-------------------- + def __task_commit_posted(self, v, posted, item): + if (not item in posted): + return 0 + + msgid = posted[item] + + with html("tr"): + html("th").print(item) + html("td").print(html("a", {"href":self.commit_url(msgid, item), + "target":"subbody"}).text(msgid)) + + return 1 + + #-------------------- # task_commit_upstream #-------------------- def task_commit_upstream(self, v): @@ -537,6 +558,8 @@ class periject_html(base.base): cnt += self.__task_commit_upstream(v, up, "torvalds") for up in upstream: cnt += self.__task_commit_upstream(v, up, "next") + for up in upstream: + cnt += self.__task_commit_posted(v, up, "lore") return (done, cnt) @@ -546,17 +569,21 @@ class periject_html(base.base): def task_commit(self, v): bsp = v.get_data("bsp-commits") + upstream = v.get_data("upstream") + with html("table", {"border":"1"}): with html("tr"): if (bsp): html("th").print("BSP") - html("th").print("upstream") + if (upstream): + html("th").print("upstream") with html("tr"): if (bsp): with html("td"): self.task_commit_bsp(bsp) - with html("td"): - self.task_commit_upstream(v) + if (upstream): + with html("td"): + self.task_commit_upstream(v) #-------------------- # task_comment |