av6 created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Feel free to ask questions, I suspect some chunks would need a comment (either
in review or in code) to explain what's going on there.
I'll start working on the other hgweb themes later, when I get feedback on
this
series.
Color choices are from the current canvas-based graph, but that probably will
change when I find a better color scheme.
I'm revisiting the idea of making graph in hgweb be SVG as opposed to canvas,
and this new page, that is separate from /graph, looks like a good testing
field: locally I have replaced canvas graph with this new SVG graph on /graph
page and it works fine and looks better, and I hope to improve the visuals
even
more. The data structures are the same (for now, at least), and SVGGraph in
mercurial.js is mostly a copy of the current Graph class.
Tooltips for different graph nodes currently work only in Chromium and similar
browsers, but it's still better than no tooltips (on cavnas).
You can see obsgraph live on http://hg-test.dwimlabs.net/
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D5538
AFFECTED FILES
contrib/wix/templates.wxs
mercurial/hgweb/webcommands.py
mercurial/templates/paper/changeset.tmpl
mercurial/templates/paper/graphentry.tmpl
mercurial/templates/paper/map
mercurial/templates/paper/obsgraph.tmpl
mercurial/templates/paper/obsgraphentry.tmpl
mercurial/templates/static/mercurial.js
mercurial/templates/static/style-paper.css
tests/test-hgweb-commands.t
tests/test-hgweb-diffs.t
tests/test-hgweb-empty.t
tests/test-hgweb-removed.t
tests/test-hgweb-symrev.t
CHANGE DETAILS
diff --git a/tests/test-hgweb-symrev.t b/tests/test-hgweb-symrev.t
--- a/tests/test-hgweb-symrev.t
+++ b/tests/test-hgweb-symrev.t
@@ -97,6 +97,7 @@
$ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'rev/xyzzy?style=paper' |
egrep $REVLINKS
log
graph
+ obsgraph
raw
browse
zip
@@ -297,6 +298,7 @@
$ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'rev/xyzzy?style=coal' |
egrep $REVLINKS
log
graph
+ obsgraph
raw
browse
zip
diff --git a/tests/test-hgweb-removed.t b/tests/test-hgweb-removed.t
--- a/tests/test-hgweb-removed.t
+++ b/tests/test-hgweb-removed.t
@@ -46,6 +46,7 @@
changeset
+ obsgraph
raw
browse
diff --git a/tests/test-hgweb-empty.t b/tests/test-hgweb-empty.t
--- a/tests/test-hgweb-empty.t
+++ b/tests/test-hgweb-empty.t
@@ -335,6 +335,156 @@
+ $ (get-with-headers.py localhost:$HGPORT 'obsgraph')
+ 200 Script output follows
+
+ http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
+ http://www.w3.org/1999/xhtml"; xml:lang="en-US">
+
+
+
+
+
+
+ test: obsolescence graph
+
+
+
+
+
+ https://mercurial-scm.org/";>
+
+
+
+ log
+ graph
+ tags
+ bookmarks
+ branches
+
+
+ changeset
+ obsgraph
+ raw
+ browse
+
+
+
+
+
+ help
+
+
+
+
+
+ Mercurial
+
+ changeset -1:
+ tip
+
+
+
+
+
+
+ Find changesets by keywords (author, files, the commit
message), revision
+ number or hash, or revset expression.
+
+
+ (none)
+
+
+
+ author
+
+
+
+ date
+ Thu, 01 Jan 1970 00:00:00 +
+
+
+
+
+ parents
+
+
+
+ children
+
+
+
+ files
+
+
+
+
+ The revision graph only works with JavaScript-enabled
browsers.
+
+
+ http://www.w3.org/2000/svg";>
+
+
+
+
+
+
+
+
+
+
+
+ normal commit
+
+
+
+ branch-closing commit
+
+
+
+ unstable commit
+
+
+
+ obsolete commit
+
+
+
+ working directory parent
+
+
+
+
+
+
+
+
+
+
+
+ (none)
+
+tip
+Thu, 01 Jan 1970 00:00:00
+, by
+
+
+
+
+
+
+ var data = [{"edges": [], "graphnode": "@o", "node": "",
"vertex": [0, 1]}];
+ var graph = new SVGGraph();
+ graph.scale(39);
+ graph.render(data);
+
+
+
+
+
+
+
+
+
$ (get-with-headers.py localhost:$HGPORT 'file')
200 Script output follows
diff --git a/tests/test-hgweb-diffs.t b/tests/test-hgweb-diffs.t
--- a/tests/test-hgweb-diffs.t
+++ b/tests/test-hgweb-diffs.t
@@ -65,6 +65,7 @@
changeset
+ obsgraph
raw
browse
@@ -362,6 +363,7 @@
changeset
+ obsgraph
raw
browse
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -859,6 +859,7 @@
changeset
+ obsgraph
raw
browse
@@ -964,6 +965,8 @@
+ $ get-with-headers.py $LOCALIP:$HGPORT 'obsgraph' | grep 'var data ='
+ var data = [{"edges": [], "graphnode": "@o", "node": "cad8025a2e87",
"vert