hgのウェブ表示で表示可能なブランチ数を増やすことはできますか?(最大15)

54 views
Skip to first unread message

ohira

unread,
Jan 18, 2016, 3:53:04 AM1/18/16
to mercurial-ja
いつもお世話になっております。
おおひらです。

hg のウェブ表示で同時に存在するブランチの多いリポジトリのグラフを表示した場合
横に並んで表示されるブランチの最大数は15で増やすことはできないのでしょうか?

hgはbitbucketやkallitheaのようにグラフが途切れないで表示されるので
頼りにしていたのです。15本というのが上限だとすると微妙な感じです。

thgは40本ぐらいまで行けそうに見えますが、hgはweb で表示ができるのが
とても便利なので、何か設定変えて増やせるものなら増やしたいです。

15本までしか表示できない画面のサンプルを添付しました。


15branches.gif

Yuya Nishihara

unread,
Jan 18, 2016, 10:21:04 AM1/18/16
to mercur...@googlegroups.com, ohira, Takumi IINO
On Mon, 18 Jan 2016 00:53:04 -0800 (PST), ohira wrote:
> hg のウェブ表示で同時に存在するブランチの多いリポジトリのグラフを表示した場合
> 横に並んで表示されるブランチの最大数は15で増やすことはできないのでしょうか?

<canvas/> の描画領域で切れているみたいですね。

https://selenic.com/repo/hg/file/3.6.3/mercurial/templates/paper/graph.tmpl#l58

ですので、幅をグラフの本数から計算するか、画面サイズに合わせて更新すれば
全て表示できると思います。

Katsunori FUJIWARA

unread,
Jan 18, 2016, 10:30:37 AM1/18/16
to mercurial-ja, ohira, Takumi IINO
藤原です。

2016年1月19日 0:20 Yuya Nishihara <yu...@tcha.org>:
Python コード側には、既に canvas 幅 (= canvaswidth) 算出ロジックが
実装されているのに、テンプレート側で width 属性に canvaswidth を利
用する修正が反映されていないのが原因みたいです。

https://selenic.com/repo/hg/rev/d490edc71146

https://selenic.com/repo/hg/file/3.6.3/mercurial/hgweb/webcommands.py#l1237

標準スタイルの paper であれば、以下の修正で正しく描画されるように
なることが確認できました。

==== 8< ==== 8< ==== 8< ==== 8< ==== 8< ====
--- a/mercurial/templates/paper/graph.tmpl
+++ b/mercurial/templates/paper/graph.tmpl
@@ -55,7 +55,7 @@

<div id="wrapper">
<ul id="nodebgs" class="stripes2"></ul>
-<canvas id="graph" width="480" height="{canvasheight}"></canvas>
+<canvas id="graph" width="{canvaswidth}" height="{canvasheight}"></canvas>
<ul id="graphnodes"></ul>
</div>

==== 8< ==== 8< ==== 8< ==== 8< ==== 8< ====

--
----------------------------------------------------------------------
FUJIWARA Katsunori(flying...@gmail.com)

Yuya Nishihara

unread,
Jan 18, 2016, 10:51:03 AM1/18/16
to mercur...@googlegroups.com, Katsunori FUJIWARA, ohira, Takumi IINO
On Tue, 19 Jan 2016 00:30:36 +0900, Katsunori FUJIWARA wrote:
> >> hg のウェブ表示で同時に存在するブランチの多いリポジトリのグラフ
> >> を表示した場合横に並んで表示されるブランチの最大数は15で増やす
> >> ことはできないのでしょうか?
> >
> > <canvas/> の描画領域で切れているみたいですね。
> >
> > https://selenic.com/repo/hg/file/3.6.3/mercurial/templates/paper/graph.tmpl#l58
> >
> > ですので、幅をグラフの本数から計算するか、画面サイズに合わせて更新すれば
> > 全て表示できると思います。
>
> Python コード側には、既に canvas 幅 (= canvaswidth) 算出ロジックが
> 実装されているのに、テンプレート側で width 属性に canvaswidth を利
> 用する修正が反映されていないのが原因みたいです。
>
> https://selenic.com/repo/hg/rev/d490edc71146
> https://selenic.com/repo/hg/file/3.6.3/mercurial/hgweb/webcommands.py#l1237

まじですか。 troter さんを召喚するまでもなかったですね。

canvaswidth について拒否されたパッチはないようですので、既知の問題はなさそう
ですね。

ohira

unread,
Jan 18, 2016, 8:05:23 PM1/18/16
to mercurial-ja, flying...@gmail.com, shin....@gmail.com, trot.t...@gmail.com, yu...@tcha.org
おおひらです。

回答ありがとうございます。

いただいた修正を行いグラフ全体が表示されるようになりました。

ありがとうございます。

表示結果のグラフを添付しました。

2016年1月19日火曜日 0時51分03秒 UTC+9 Yuya Nishihara:
15lines.png
Reply all
Reply to author
Forward
0 new messages