[PATCH 5 of 5 V2] templates: add support for graph webcommand in json style
Laura Médioni
laura.medioni at logilab.fr
Mon Jun 20 05:02:23 EDT 2016
On 06/16/2016 12:16 PM, Anton Shestakov wrote:
> 15.06.2016, 22:48, "Laura Médioni" <laura.medioni at logilab.fr>:
>> # HG changeset patch
>> # User Laura Médioni <laura.medioni at logilab.fr>
>> # Date 1465806567 -7200
>> # Mon Jun 13 10:29:27 2016 +0200
>> # Node ID 9fc3e7b7ea8f8d77e4167dfa5c63ee2c37d3690d
>> # Parent 33c362973b2ab07b2e20d6818b7e72473e682fd4
>> templates: add support for graph webcommand in json style
> There doesn't seem to be anything wrong with this patch, but after the previous ones that display that nice self-describing format for data, where things are just self-explanatory and are easy to get, this one just pains me.
>
> Do you have any plans to improve graph in hgweb? Can we expose data in a better structure?
>
> Just look at this ugly sucker:
I agree this is unreadable. I reused the data structure that was created
for the js widget that currently displays the graph.
The truth is I doubt this is useful outside this context, and if we
wanted to expose graph data we should do it with a better structure.
I don't know is there is right now a real need for such a thing...
Actually we hadn't planned to spend more time on it and maybe the best
thing would just be to kill this changeset.
>
>> diff --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t
>> --- a/tests/test-hgweb-json.t
>> +++ b/tests/test-hgweb-json.t
>> @@ -1335,11 +1335,330 @@ filelog/{revision}/{path} shows history
>> graph/ shows information that can be used to render a graph of the DAG
>>
>> $ request json-graph
>> 200 Script output follows
>>
>> - "not yet implemented"
>> + {
>> + "graphdata": [
>> + [
>> + "cc725e08502a",
>> + [
>> + 0,
>> + 1
>> + ],
>> + [
>> + [
>> + 0,
>> + 0,
>> + 1,
>> + -1,
>> + ""
>> + ],
>> + [
>> + 0,
>> + 1,
>> + 1,
>> + -1,
>> + ""
>> + ]
>> + ],
>> + "merge test-branch into default",
>> + "test",
>> + "1970-01-01",
>> + [
>> + "default",
>> + true
>> + ],
>> + [
>> + "tip"
>> + ],
>> + []
>> + ],
>> + [
>> + "ed66c30e87eb",
>> + [
>> + 1,
>> + 2
>> + ],
>> + [
>> + [
>> + 0,
>> + 0,
>> + 1,
>> + -1,
>> + ""
>> + ],
>> + [
>> + 1,
>> + 1,
>> + 2,
>> + -1,
>> + ""
>> + ]
>> + ],
>> + "another commit in test-branch",
>> + "test",
>> + "1970-01-01",
>> + [
>> + "test-branch",
>> + true
>> + ],
>> + [],
>> + []
>> + ],
>> + [
>> + "6ab967a8ab34",
>> + [
>> + 1,
>> + 2
>> + ],
>> + [
>> + [
>> + 0,
>> + 0,
>> + 1,
>> + -1,
>> + ""
>> + ],
>> + [
>> + 1,
>> + 1,
>> + 2,
>> + -1,
>> + ""
>> + ]
>> + ],
>> + "create test branch",
>> + "test",
>> + "1970-01-01",
>> + [
>> + "test-branch",
>> + false
>> + ],
>> + [],
>> + []
>> + ],
>> + [
>> + "ceed296fe500",
>> + [
>> + 0,
>> + 1
>> + ],
>> + [
>> + [
>> + 0,
>> + 0,
>> + 1,
>> + -1,
>> + ""
>> + ],
>> + [
>> + 1,
>> + 1,
>> + 2,
>> + -1,
>> + ""
>> + ]
>> + ],
>> + "create tag2",
>> + "test",
>> + "1970-01-01",
>> + [
>> + "default",
>> + false
>> + ],
>> + [],
>> + [
>> + "bookmark2"
>> + ]
>> + ],
>> + [
>> + "f2890a05fea4",
>> + [
>> + 0,
>> + 1
>> + ],
>> + [
>> + [
>> + 0,
>> + 0,
>> + 1,
>> + -1,
>> + ""
>> + ],
>> + [
>> + 1,
>> + 1,
>> + 2,
>> + -1,
>> + ""
>> + ]
>> + ],
>> + "another commit to da/foo",
>> + "test",
>> + "1970-01-01",
>> + [
>> + "default",
>> + false
>> + ],
>> + [
>> + "tag2"
>> + ],
>> + []
>> + ],
>> + [
>> + "93a8ce14f891",
>> + [
>> + 0,
>> + 1
>> + ],
>> + [
>> + [
>> + 0,
>> + 0,
>> + 1,
>> + -1,
>> + ""
>> + ],
>> + [
>> + 1,
>> + 1,
>> + 2,
>> + -1,
>> + ""
>> + ]
>> + ],
>> + "create tag",
>> + "test",
>> + "1970-01-01",
>> + [
>> + "default",
>> + false
>> + ],
>> + [],
>> + []
>> + ],
>> + [
>> + "78896eb0e102",
>> + [
>> + 0,
>> + 1
>> + ],
>> + [
>> + [
>> + 0,
>> + 0,
>> + 1,
>> + -1,
>> + ""
>> + ],
>> + [
>> + 1,
>> + 1,
>> + 2,
>> + -1,
>> + ""
>> + ]
>> + ],
>> + "move foo",
>> + "test",
>> + "1970-01-01",
>> + [
>> + "default",
>> + false
>> + ],
>> + [
>> + "tag1"
>> + ],
>> + []
>> + ],
>> + [
>> + "8d7c456572ac",
>> + [
>> + 0,
>> + 1
>> + ],
>> + [
>> + [
>> + 0,
>> + 0,
>> + 1,
>> + -1,
>> + ""
>> + ],
>> + [
>> + 1,
>> + 1,
>> + 2,
>> + -1,
>> + ""
>> + ]
>> + ],
>> + "modify da/foo",
>> + "test",
>> + "1970-01-01",
>> + [
>> + "default",
>> + false
>> + ],
>> + [],
>> + [
>> + "bookmark1"
>> + ]
>> + ],
>> + [
>> + "f8bbb9024b10",
>> + [
>> + 0,
>> + 1
>> + ],
>> + [
>> + [
>> + 0,
>> + 0,
>> + 1,
>> + -1,
>> + ""
>> + ],
>> + [
>> + 1,
>> + 0,
>> + 2,
>> + -1,
>> + ""
>> + ]
>> + ],
>> + "modify foo",
>> + "test",
>> + "1970-01-01",
>> + [
>> + "default",
>> + false
>> + ],
>> + [],
>> + []
>> + ],
>> + [
>> + "06e557f3edf6",
>> + [
>> + 0,
>> + 2
>> + ],
>> + [],
>> + "initial",
>> + "test",
>> + "1970-01-01",
>> + [
>> + "default",
>> + false
>> + ],
>> + [],
>> + []
>> + ]
>> + ],
>> + "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
>> + }
>>
>> help/ shows help topics
>>
>> $ request json-help
>> 200 Script output follows
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel at mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
--
Laura Médioni - LOGILAB, Toulouse ((+33) 5 62 17 16 42)
More information about the Mercurial-devel
mailing list