obshistory: add a json test with cycles
authorBoris Feld <boris.feld@octobus.net>
Thu, 18 May 2017 18:35:34 +0200
changeset 2420 94d1c7a1905a
parent 2419 4ac190d88b57
child 2421 090b5a591916
obshistory: add a json test with cycles
tests/test-evolve-obshistory.t
--- a/tests/test-evolve-obshistory.t	Thu May 18 18:40:20 2017 +0200
+++ b/tests/test-evolve-obshistory.t	Thu May 18 18:35:34 2017 +0200
@@ -1445,3 +1445,118 @@
   x |  c473644ee0e9 (2) B
   | |    rewritten by test (*20*) as a8df460dbbfe (glob)
   | |
+
+Check the json output is valid in this case
+
+  $ hg olog "desc(D)" --hidden --no-graph -Tjson | python -m json.tool
+  [
+      {
+          "debugobshistory.markers": [
+              {
+                  "debugobshistory.marker_date": [
+                      *, (glob)
+                      0
+                  ],
+                  "debugobshistory.marker_user": "test",
+                  "debugobshistory.succnodes": [
+                      "0da815c333f6"
+                  ],
+                  "debugobshistory.verb": "rewritten"
+              }
+          ],
+          "debugobshistory.node": "868d2e0eb19c",
+          "debugobshistory.rev": 4,
+          "debugobshistory.shortdescription": "D"
+      },
+      {
+          "debugobshistory.markers": [
+              {
+                  "debugobshistory.marker_date": [
+                      *, (glob)
+                      0
+                  ],
+                  "debugobshistory.marker_user": "test",
+                  "debugobshistory.succnodes": [
+                      "868d2e0eb19c"
+                  ],
+                  "debugobshistory.verb": "rewritten"
+              }
+          ],
+          "debugobshistory.node": "d9f908fde1a1",
+          "debugobshistory.rev": 6,
+          "debugobshistory.shortdescription": "F"
+      },
+      {
+          "debugobshistory.markers": [
+              {
+                  "debugobshistory.marker_date": [
+                      *, (glob)
+                      0
+                  ],
+                  "debugobshistory.marker_user": "test",
+                  "debugobshistory.succnodes": [
+                      "d9f908fde1a1"
+                  ],
+                  "debugobshistory.verb": "rewritten"
+              }
+          ],
+          "debugobshistory.node": "0da815c333f6",
+          "debugobshistory.rev": 5,
+          "debugobshistory.shortdescription": "E"
+      },
+      {
+          "debugobshistory.markers": [
+              {
+                  "debugobshistory.marker_date": [
+                      *, (glob)
+                      0
+                  ],
+                  "debugobshistory.marker_user": "test",
+                  "debugobshistory.succnodes": [
+                      "2a34000d3544",
+                      "868d2e0eb19c"
+                  ],
+                  "debugobshistory.verb": "rewritten"
+              }
+          ],
+          "debugobshistory.node": "a8df460dbbfe",
+          "debugobshistory.rev": 3,
+          "debugobshistory.shortdescription": "C"
+      },
+      {
+          "debugobshistory.markers": [
+              {
+                  "debugobshistory.marker_date": [
+                      *, (glob)
+                      0
+                  ],
+                  "debugobshistory.marker_user": "test",
+                  "debugobshistory.succnodes": [
+                      "a8df460dbbfe"
+                  ],
+                  "debugobshistory.verb": "rewritten"
+              }
+          ],
+          "debugobshistory.node": "c473644ee0e9",
+          "debugobshistory.rev": 2,
+          "debugobshistory.shortdescription": "B"
+      },
+      {
+          "debugobshistory.markers": [
+              {
+                  "debugobshistory.marker_date": [
+                      *, (glob)
+                      0
+                  ],
+                  "debugobshistory.marker_user": "test",
+                  "debugobshistory.succnodes": [
+                      "c473644ee0e9"
+                  ],
+                  "debugobshistory.verb": "rewritten"
+              }
+          ],
+          "debugobshistory.node": "2a34000d3544",
+          "debugobshistory.rev": 1,
+          "debugobshistory.shortdescription": "A"
+      }
+  ]