diff tests/test-evolve-obshistory.t @ 2957:586c9ace20b3

obslog: simplify formatter keys The formatter field keys are all prefixed with `debugobshistory.'. This is annoyingly useless as they are already in the `debughistory` topic. This patch simplify these keys. For examle, on this repository `hg obslog -Tdebug -r 31cbace4c0f1` : ``` debugobshistory = [ { 'node':'31cbace4c0f1', 'shortdescription':'topics: make sure we have some restrictions on topic names', 'rev':2904, 'markers':[ ] }, { 'node':'d439a6087434', 'markers':[ { 'date':(1504176329.83902, -7200 ), 'verb':'rewritten', 'succnodes':[ '31cbace4c0f1' ], 'effect':[ 'parent' ], 'user':'Pierre-Yves David <pierre-yves.david@octobus.net>' } ] }, { 'node':'1e1f651704d4', 'markers':[ { 'date':(1504175088.811924, -7200 ), 'verb':'rewritten', 'succnodes':[ 'd439a6087434' ], 'effect':[ 'parent' ], 'user':'Pierre-Yves David <pierre-yves.david@octobus.net>' } ] }, { 'node':'eb6495cf6cb1', 'markers':[ { 'date':(1504015275.001643, -19800 ), 'verb':'rewritten', 'succnodes':[ '1e1f651704d4' ], 'effect':[ 'parent', 'content' ], 'user':'Pulkit Goyal <7895pulkit@gmail.com>' } ] }, { 'node':'761e446e0112', 'markers':[ { 'date':(1504015201.780276, -19800 ), 'verb':'rewritten', 'succnodes':[ 'eb6495cf6cb1' ], 'effect':[ 'content' ], 'user':'Pulkit Goyal <7895pulkit@gmail.com>' } ] }, { 'node':'531a626950bd', 'markers':[ { 'date':(1504015017.897054, -19800 ), 'verb':'rewritten', 'succnodes':[ '761e446e0112' ], 'effect':[ 'meta', 'parent', 'content' ], 'user':'Pulkit Goyal <7895pulkit@gmail.com>' } ] }, { 'node':'c2f9ba7329ea', 'markers':[ { 'date':(1504014136.876537, -19800 ), 'verb':'rewritten', 'succnodes':[ '531a626950bd' ], 'effect':[ 'meta' ], 'user':'Pulkit Goyal <7895pulkit@gmail.com>' } ] }, ] ``` We now able to ask `hg obslog -r 78debdfb3e4d -T '{label("log.summary", shortdescription)}\n{if(markers, markers % " {date|age} {user|person}\n")}'` ``` doc: simplify the reference to in-core features 9 days ago Pierre-Yves David 9 days ago Pierre-Yves David 9 days ago Pierre-Yves David 9 days ago Pierre-Yves David 9 days ago Philippe Pepiot 9 days ago Philippe Pepiot ```
author Alain Leufroy
date Fri, 08 Sep 2017 12:10:21 +0200
parents bc9bc1778463
children bd7e8be29542
line wrap: on
line diff
--- a/tests/test-evolve-obshistory.t	Fri Sep 08 12:03:23 2017 +0200
+++ b/tests/test-evolve-obshistory.t	Fri Sep 08 12:10:21 2017 +0200
@@ -93,52 +93,40 @@
       +42
   
 
-  $ hg obslog 4ae3a4151de9 --graph -Tjson
-  @  [
-  |   {
-  |    "debugobshistory.markers": [],
-  |    "debugobshistory.node": "4ae3a4151de9",
-  |    "debugobshistory.rev": 2,
-  |    "debugobshistory.shortdescription": "A1"
-  |   }
-  |  ]
-  x  [
-      {
-       "debugobshistory.markers": [{"debugobshistory.effect": ["description", "content"], "debugobshistory.marker_date": [0.0, 0], "debugobshistory.marker_user": "test", "debugobshistory.succnodes": ["4ae3a4151de9"], "debugobshistory.verb": "rewritten"}],
-       "debugobshistory.node": "471f378eab4c",
-       "debugobshistory.rev": 1,
-       "debugobshistory.shortdescription": "A0"
-      }
-     ]
+  $ hg obslog 4ae3a4151de9 --graph -T'{label("log.summary", shortdescription)} {if(markers, join(markers % "at {date|hgdate} by {user|person} ", " also "))}'
+  @  A1
+  |
+  x  A0 at 0 0 by test
+  
   $ hg obslog 4ae3a4151de9 --no-graph -Tjson | python -m json.tool
   [
       {
-          "debugobshistory.markers": [],
-          "debugobshistory.node": "4ae3a4151de9",
-          "debugobshistory.rev": 2,
-          "debugobshistory.shortdescription": "A1"
+          "markers": [],
+          "node": "4ae3a4151de9",
+          "rev": 2,
+          "shortdescription": "A1"
       },
       {
-          "debugobshistory.markers": [
+          "markers": [
               {
-                  "debugobshistory.effect": [
+                  "date": [
+                      *, (glob)
+                      0 (glob)
+                  ],
+                  "effect": [
                       "description",
                       "content"
                   ],
-                  "debugobshistory.marker_date": [
-                      *, (glob)
-                      0 (glob)
-                  ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.succnodes": [
+                  "succnodes": [
                       "4ae3a4151de9"
                   ],
-                  "debugobshistory.verb": "rewritten"
+                  "user": "test",
+                  "verb": "rewritten"
               }
           ],
-          "debugobshistory.node": "471f378eab4c",
-          "debugobshistory.rev": 1,
-          "debugobshistory.shortdescription": "A0"
+          "node": "471f378eab4c",
+          "rev": 1,
+          "shortdescription": "A0"
       }
   ]
   $ hg obslog --hidden --patch 471f378eab4c
@@ -163,26 +151,26 @@
   $ hg obslog --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool
   [
       {
-          "debugobshistory.markers": [
+          "markers": [
               {
-                  "debugobshistory.effect": [
-                      *, (glob)
-                      "content"
-                  ],
-                  "debugobshistory.marker_date": [
+                  "date": [
                       *, (glob)
                       0 (glob)
                   ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.succnodes": [
+                  "effect": [
+                      *, (glob)
+                      "content"
+                  ],
+                  "succnodes": [
                       "4ae3a4151de9"
                   ],
-                  "debugobshistory.verb": "rewritten"
+                  "user": "test",
+                  "verb": "rewritten"
               }
           ],
-          "debugobshistory.node": "471f378eab4c",
-          "debugobshistory.rev": 1,
-          "debugobshistory.shortdescription": "A0"
+          "node": "471f378eab4c",
+          "rev": 1,
+          "shortdescription": "A0"
       }
   ]
   $ hg update 471f378eab4c
@@ -256,19 +244,19 @@
   $ hg obslog 'desc(B0)' --hidden --no-graph -Tjson | python -m json.tool
   [
       {
-          "debugobshistory.markers": [
+          "markers": [
               {
-                  "debugobshistory.marker_date": [
+                  "date": [
                       *, (glob)
                       0 (glob)
                   ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.verb": "pruned"
+                  "user": "test",
+                  "verb": "pruned"
               }
           ],
-          "debugobshistory.node": "0dec01379d3b",
-          "debugobshistory.rev": 2,
-          "debugobshistory.shortdescription": "B0"
+          "node": "0dec01379d3b",
+          "rev": 2,
+          "shortdescription": "B0"
       }
   ]
   $ hg obslog 'desc(A0)' --patch
@@ -277,10 +265,10 @@
   $ hg obslog 'desc(A0)' --no-graph -Tjson | python -m json.tool
   [
       {
-          "debugobshistory.markers": [],
-          "debugobshistory.node": "471f378eab4c",
-          "debugobshistory.rev": 1,
-          "debugobshistory.shortdescription": "A0"
+          "markers": [],
+          "node": "471f378eab4c",
+          "rev": 1,
+          "shortdescription": "A0"
       }
   ]
   $ hg up 1
@@ -391,27 +379,27 @@
   $ hg obslog 471597cad322 --hidden --no-graph -Tjson | python -m json.tool
   [
       {
-          "debugobshistory.markers": [
+          "markers": [
               {
-                  "debugobshistory.effect": [
-                      "parent",
-                      "content"
-                  ],
-                  "debugobshistory.marker_date": [
+                  "date": [
                       *, (glob)
                       0 (glob)
                   ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.succnodes": [
+                  "effect": [
+                      "parent",
+                      "content"
+                  ],
+                  "succnodes": [
                       "337fec4d2edc",
                       "f257fde29c7a"
                   ],
-                  "debugobshistory.verb": "rewritten"
+                  "user": "test",
+                  "verb": "rewritten"
               }
           ],
-          "debugobshistory.node": "471597cad322",
-          "debugobshistory.rev": 1,
-          "debugobshistory.shortdescription": "A0"
+          "node": "471597cad322",
+          "rev": 1,
+          "shortdescription": "A0"
       }
   ]
 Check that debugobshistory on the first successor after split show
@@ -657,29 +645,29 @@
   $ hg obslog de7290d8b885 --hidden --no-graph -Tjson | python -m json.tool
   [
       {
-          "debugobshistory.markers": [
+          "markers": [
               {
-                  "debugobshistory.effect": [
+                  "date": [
+                      *, (glob)
+                      0 (glob)
+                  ],
+                  "effect": [
                       "parent",
                       "content"
                   ],
-                  "debugobshistory.marker_date": [
-                      *, (glob)
-                      0 (glob)
-                  ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.succnodes": [
+                  "succnodes": [
                       "1ae8bc733a14",
                       "337fec4d2edc",
                       "c7f044602e9b",
                       "f257fde29c7a"
                   ],
-                  "debugobshistory.verb": "rewritten"
+                  "user": "test",
+                  "verb": "rewritten"
               }
           ],
-          "debugobshistory.node": "de7290d8b885",
-          "debugobshistory.rev": 1,
-          "debugobshistory.shortdescription": "A0"
+          "node": "de7290d8b885",
+          "rev": 1,
+          "shortdescription": "A0"
       }
   ]
   $ hg obslog c7f044602e9b --patch
@@ -692,35 +680,35 @@
   $ hg obslog c7f044602e9b --no-graph -Tjson | python -m json.tool
   [
       {
-          "debugobshistory.markers": [],
-          "debugobshistory.node": "c7f044602e9b",
-          "debugobshistory.rev": 5,
-          "debugobshistory.shortdescription": "A0"
+          "markers": [],
+          "node": "c7f044602e9b",
+          "rev": 5,
+          "shortdescription": "A0"
       },
       {
-          "debugobshistory.markers": [
+          "markers": [
               {
-                  "debugobshistory.effect": [
+                  "date": [
+                      *, (glob)
+                      0 (glob)
+                  ],
+                  "effect": [
                       "parent",
                       "content"
                   ],
-                  "debugobshistory.marker_date": [
-                      *, (glob)
-                      0 (glob)
-                  ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.succnodes": [
+                  "succnodes": [
                       "1ae8bc733a14",
                       "337fec4d2edc",
                       "c7f044602e9b",
                       "f257fde29c7a"
                   ],
-                  "debugobshistory.verb": "rewritten"
+                  "user": "test",
+                  "verb": "rewritten"
               }
           ],
-          "debugobshistory.node": "de7290d8b885",
-          "debugobshistory.rev": 1,
-          "debugobshistory.shortdescription": "A0"
+          "node": "de7290d8b885",
+          "rev": 1,
+          "shortdescription": "A0"
       }
   ]
 Check that debugobshistory on all heads show a coherent graph
@@ -916,55 +904,55 @@
   $ hg obslog eb5a0daa2192 --no-graph -Tjson | python -m json.tool
   [
       {
-          "debugobshistory.markers": [],
-          "debugobshistory.node": "eb5a0daa2192",
-          "debugobshistory.rev": 3,
-          "debugobshistory.shortdescription": "C0"
+          "markers": [],
+          "node": "eb5a0daa2192",
+          "rev": 3,
+          "shortdescription": "C0"
       },
       {
-          "debugobshistory.markers": [
+          "markers": [
               {
-                  "debugobshistory.effect": [
-                      "description",
-                      "content"
-                  ],
-                  "debugobshistory.marker_date": [
+                  "date": [
                       *, (glob)
                       0 (glob)
                   ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.succnodes": [
+                  "effect": [
+                      "description",
+                      "content"
+                  ],
+                  "succnodes": [
                       "eb5a0daa2192"
                   ],
-                  "debugobshistory.verb": "rewritten"
+                  "user": "test",
+                  "verb": "rewritten"
               }
           ],
-          "debugobshistory.node": "471f378eab4c",
-          "debugobshistory.rev": 1,
-          "debugobshistory.shortdescription": "A0"
+          "node": "471f378eab4c",
+          "rev": 1,
+          "shortdescription": "A0"
       },
       {
-          "debugobshistory.markers": [
+          "markers": [
               {
-                  "debugobshistory.effect": [
+                  "date": [
+                      *, (glob)
+                      0 (glob)
+                  ],
+                  "effect": [
                       "description",
                       "parent",
                       "content"
                   ],
-                  "debugobshistory.marker_date": [
-                      *, (glob)
-                      0 (glob)
-                  ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.succnodes": [
+                  "succnodes": [
                       "eb5a0daa2192"
                   ],
-                  "debugobshistory.verb": "rewritten"
+                  "user": "test",
+                  "verb": "rewritten"
               }
           ],
-          "debugobshistory.node": "0dec01379d3b",
-          "debugobshistory.rev": 2,
-          "debugobshistory.shortdescription": "B0"
+          "node": "0dec01379d3b",
+          "rev": 2,
+          "shortdescription": "B0"
       }
   ]
   $ hg update 471f378eab4c
@@ -1097,39 +1085,39 @@
   $ hg obslog --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool
   [
       {
-          "debugobshistory.markers": [
+          "markers": [
               {
-                  "debugobshistory.effect": [
-                      "description"
-                  ],
-                  "debugobshistory.marker_date": [
+                  "date": [
                       *, (glob)
                       0 (glob)
                   ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.succnodes": [
+                  "effect": [
+                      "description"
+                  ],
+                  "succnodes": [
                       "65b757b745b9"
                   ],
-                  "debugobshistory.verb": "rewritten"
+                  "user": "test",
+                  "verb": "rewritten"
               },
               {
-                  "debugobshistory.effect": [
-                      "description"
-                  ],
-                  "debugobshistory.marker_date": [
+                  "date": [
                       *, (glob)
                       0 (glob)
                   ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.succnodes": [
+                  "effect": [
+                      "description"
+                  ],
+                  "succnodes": [
                       "fdf9bde5129a"
                   ],
-                  "debugobshistory.verb": "rewritten"
+                  "user": "test",
+                  "verb": "rewritten"
               }
           ],
-          "debugobshistory.node": "471f378eab4c",
-          "debugobshistory.rev": 1,
-          "debugobshistory.shortdescription": "A0"
+          "node": "471f378eab4c",
+          "rev": 1,
+          "shortdescription": "A0"
       }
   ]
 Check that debugobshistory on the first diverged revision show the revision
@@ -1245,51 +1233,51 @@
   $ hg obslog '65b757b745b9+fdf9bde5129a' --no-graph -Tjson | python -m json.tool
   [
       {
-          "debugobshistory.markers": [],
-          "debugobshistory.node": "65b757b745b9",
-          "debugobshistory.rev": 3,
-          "debugobshistory.shortdescription": "A2"
+          "markers": [],
+          "node": "65b757b745b9",
+          "rev": 3,
+          "shortdescription": "A2"
       },
       {
-          "debugobshistory.markers": [
+          "markers": [
               {
-                  "debugobshistory.effect": [
-                      "description"
-                  ],
-                  "debugobshistory.marker_date": [
+                  "date": [
                       *, (glob)
                       0 (glob)
                   ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.succnodes": [
+                  "effect": [
+                      "description"
+                  ],
+                  "succnodes": [
                       "65b757b745b9"
                   ],
-                  "debugobshistory.verb": "rewritten"
+                  "user": "test",
+                  "verb": "rewritten"
               },
               {
-                  "debugobshistory.effect": [
-                      "description"
-                  ],
-                  "debugobshistory.marker_date": [
+                  "date": [
                       *, (glob)
                       0 (glob)
                   ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.succnodes": [
+                  "effect": [
+                      "description"
+                  ],
+                  "succnodes": [
                       "fdf9bde5129a"
                   ],
-                  "debugobshistory.verb": "rewritten"
+                  "user": "test",
+                  "verb": "rewritten"
               }
           ],
-          "debugobshistory.node": "471f378eab4c",
-          "debugobshistory.rev": 1,
-          "debugobshistory.shortdescription": "A0"
+          "node": "471f378eab4c",
+          "rev": 1,
+          "shortdescription": "A0"
       },
       {
-          "debugobshistory.markers": [],
-          "debugobshistory.node": "fdf9bde5129a",
-          "debugobshistory.rev": 2,
-          "debugobshistory.shortdescription": "A1"
+          "markers": [],
+          "node": "fdf9bde5129a",
+          "rev": 2,
+          "shortdescription": "A1"
       }
   ]
   $ hg update 471f378eab4c
@@ -1442,76 +1430,76 @@
   $ hg obslog eb5a0daa2192 --no-graph -Tjson | python -m json.tool
   [
       {
-          "debugobshistory.markers": [],
-          "debugobshistory.node": "eb5a0daa2192",
-          "debugobshistory.rev": 4,
-          "debugobshistory.shortdescription": "C0"
+          "markers": [],
+          "node": "eb5a0daa2192",
+          "rev": 4,
+          "shortdescription": "C0"
       },
       {
-          "debugobshistory.markers": [
+          "markers": [
               {
-                  "debugobshistory.effect": [
+                  "date": [
+                      *, (glob)
+                      0 (glob)
+                  ],
+                  "effect": [
                       *, (glob)
                       *, (glob)
                       "content"
                   ],
-                  "debugobshistory.marker_date": [
-                      *, (glob)
-                      0 (glob)
-                  ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.succnodes": [
+                  "succnodes": [
                       "eb5a0daa2192"
                   ],
-                  "debugobshistory.verb": "rewritten"
+                  "user": "test",
+                  "verb": "rewritten"
               }
           ],
-          "debugobshistory.node": "b7ea6d14e664",
-          "debugobshistory.rev": 3,
-          "debugobshistory.shortdescription": "B1"
+          "node": "b7ea6d14e664",
+          "rev": 3,
+          "shortdescription": "B1"
       },
       {
-          "debugobshistory.markers": [
+          "markers": [
               {
-                  "debugobshistory.effect": [
-                      "description"
-                  ],
-                  "debugobshistory.marker_date": [
+                  "date": [
                       *, (glob)
                       0 (glob)
                   ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.succnodes": [
+                  "effect": [
+                      "description"
+                  ],
+                  "succnodes": [
                       "b7ea6d14e664"
                   ],
-                  "debugobshistory.verb": "rewritten"
+                  "user": "test",
+                  "verb": "rewritten"
               }
           ],
-          "debugobshistory.node": "0dec01379d3b",
-          "debugobshistory.rev": 2,
-          "debugobshistory.shortdescription": "B0"
+          "node": "0dec01379d3b",
+          "rev": 2,
+          "shortdescription": "B0"
       },
       {
-          "debugobshistory.markers": [
+          "markers": [
               {
-                  "debugobshistory.effect": [
+                  "date": [
+                      *, (glob)
+                      0 (glob)
+                  ],
+                  "effect": [
                       "description",
                       "content"
                   ],
-                  "debugobshistory.marker_date": [
-                      *, (glob)
-                      0 (glob)
-                  ],
-                  "debugobshistory.marker_user": "test",
-                  "debugobshistory.succnodes": [
+                  "succnodes": [
                       "eb5a0daa2192"
                   ],
-                  "debugobshistory.verb": "rewritten"
+                  "user": "test",
+                  "verb": "rewritten"
               }
           ],
-          "debugobshistory.node": "471f378eab4c",
-          "debugobshistory.rev": 1,
-          "debugobshistory.shortdescription": "A0"
+          "node": "471f378eab4c",
+          "rev": 1,
+          "shortdescription": "A0"
       }
   ]
   $ hg update 471f378eab4c