changeset 2603:23f1c3b9052f

template: use hex successors in obsfate This was spotted by Yuya.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 16 Jun 2017 17:34:02 +0200
parents 31d3be16e65c
children 3bcc9d3bac33
files hgext3rd/evolve/obshistory.py hgext3rd/evolve/templatekw.py tests/test-evolve-templates.t
diffstat 3 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/obshistory.py	Fri Jun 16 17:21:49 2017 +0200
+++ b/hgext3rd/evolve/obshistory.py	Fri Jun 16 17:34:02 2017 +0200
@@ -675,6 +675,8 @@
     """
     markers = _successorsetallmarkers(successorset, pathscache)
 
+    successorset = [nodemod.hex(n) for n in successorset]
+
     # Format basic data
     data = {
         "successors": sorted(successorset),
--- a/hgext3rd/evolve/templatekw.py	Fri Jun 16 17:21:49 2017 +0200
+++ b/hgext3rd/evolve/templatekw.py	Fri Jun 16 17:34:02 2017 +0200
@@ -146,7 +146,7 @@
         # As we can't do something like
         # "{join(map(nodeshort, successors), ', '}" in template, manually
         # create a correct textual representation
-        gen = ', '.join(map(node.short, raw['successors']))
+        gen = ', '.join(n[:12] for n in raw['successors'])
 
         makemap = lambda x: {'successor': x}
         joinfmt = lambda d: "%s" % d['successor']
--- a/tests/test-evolve-templates.t	Fri Jun 16 17:21:49 2017 +0200
+++ b/tests/test-evolve-templates.t	Fri Jun 16 17:34:02 2017 +0200
@@ -236,11 +236,11 @@
   $ hg fatelogjson --hidden
   @  d004c8f274b9 ""
   |
-  | x  a468dc9b3633 [{"markers": [["\udca4h\u071b63\udc8b\u0014\udcfd\udcb7\udc82_U\udcce=\udcf4\udce7\u0015\u0017\udcad", ["\udcd0\u0004\udcc8\udcf2t\udcb9\udcecH\nG\udca9\u003c\u0010\udcda\udcc5\udcee\udce6:\udcdbx"], 0, [["ef1", "1"], ["user", "test2"]], [987654321.0, 0], null]], "max_date": [987654321.0, 0], "min_date": [987654321.0, 0], "successors": ["\udcd0\u0004\udcc8\udcf2t\udcb9\udcecH\nG\udca9\u003c\u0010\udcda\udcc5\udcee\udce6:\udcdbx"], "users": ["test2"], "verb": "rewritten"}]
+  | x  a468dc9b3633 [{"markers": [["\udca4h\u071b63\udc8b\u0014\udcfd\udcb7\udc82_U\udcce=\udcf4\udce7\u0015\u0017\udcad", ["\udcd0\u0004\udcc8\udcf2t\udcb9\udcecH\nG\udca9\u003c\u0010\udcda\udcc5\udcee\udce6:\udcdbx"], 0, [["ef1", "1"], ["user", "test2"]], [987654321.0, 0], null]], "max_date": [987654321.0, 0], "min_date": [987654321.0, 0], "successors": ["d004c8f274b9ec480a47a93c10dac5eee63adb78"], "users": ["test2"], "verb": "rewritten"}]
   |/
   | x  f137d23bb3e1 [{"markers": [], "successors": [], "verb": "pruned"}]
   | |
-  | x  471f378eab4c [{"markers": [["G\u001f7\udc8e\udcabL^%\udcf6\udcc7\u007fx['\udcc96\udcef\udcb2(t", ["\udca4h\u071b63\udc8b\u0014\udcfd\udcb7\udc82_U\udcce=\udcf4\udce7\u0015\u0017\udcad"], 0, [["ef1", "9"], ["user", "test1"]], [1234567890.0, 0], null]], "max_date": [1234567890.0, 0], "min_date": [1234567890.0, 0], "successors": ["\udca4h\u071b63\udc8b\u0014\udcfd\udcb7\udc82_U\udcce=\udcf4\udce7\u0015\u0017\udcad"], "users": ["test1"], "verb": "rewritten"}]
+  | x  471f378eab4c [{"markers": [["G\u001f7\udc8e\udcabL^%\udcf6\udcc7\u007fx['\udcc96\udcef\udcb2(t", ["\udca4h\u071b63\udc8b\u0014\udcfd\udcb7\udc82_U\udcce=\udcf4\udce7\u0015\u0017\udcad"], 0, [["ef1", "9"], ["user", "test1"]], [1234567890.0, 0], null]], "max_date": [1234567890.0, 0], "min_date": [1234567890.0, 0], "successors": ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"], "users": ["test1"], "verb": "rewritten"}]
   |/
   o  ea207398892e ""
   
@@ -405,7 +405,7 @@
   |
   o  337fec4d2edc ""
   |
-  | x  471597cad322 [{"markers": [["G\u0015\udc97\udcca\udcd3\"\udcd1\udcf6Y\udcbb\u0016\udc97Q\udcbe\udc913\udcda\udcd9.\udcf3", ["3\u007f\udcecM.\udcdc\udcf0\udce7\udca4g\udce3_\udc81\udc824\udcbcb\u0000h\udcb5", "\udcf2W\udcfd\udce2\udc9cz\udc84|\udc9b`\u007fn\udc95\udc86V\udcd0\udcdf\u000f\udcb1\\"], 0, [["ef1", "12"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["3\u007f\udcecM.\udcdc\udcf0\udce7\udca4g\udce3_\udc81\udc824\udcbcb\u0000h\udcb5", "\udcf2W\udcfd\udce2\udc9cz\udc84|\udc9b`\u007fn\udc95\udc86V\udcd0\udcdf\u000f\udcb1\\"], "users": ["test"], "verb": "rewritten"}]
+  | x  471597cad322 [{"markers": [["G\u0015\udc97\udcca\udcd3\"\udcd1\udcf6Y\udcbb\u0016\udc97Q\udcbe\udc913\udcda\udcd9.\udcf3", ["3\u007f\udcecM.\udcdc\udcf0\udce7\udca4g\udce3_\udc81\udc824\udcbcb\u0000h\udcb5", "\udcf2W\udcfd\udce2\udc9cz\udc84|\udc9b`\u007fn\udc95\udc86V\udcd0\udcdf\u000f\udcb1\\"], 0, [["ef1", "12"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["337fec4d2edcf0e7a467e35f818234bc620068b5", "f257fde29c7a847c9b607f6e958656d0df0fb15c"], "users": ["test"], "verb": "rewritten"}]
   |/
   o  ea207398892e ""
   
@@ -570,9 +570,9 @@
   $ hg fatelogjson --hidden
   @  eb5a0daa2192 ""
   |
-  | x  0dec01379d3b [{"markers": [["\r\udcec\u00017\udc9d;\udce61\udc8cG\u000e\udcad1\udcb1\udcfez\udce7\udccbS\udcd5", ["\udcebZ\r\udcaa!\udc92;\udcbf\udc8c\udcae\udcb2\udcc4 \udc85\udcb9\udce4c\udc86\u001f\udcd0"], 0, [["ef1", "13"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["\udcebZ\r\udcaa!\udc92;\udcbf\udc8c\udcae\udcb2\udcc4 \udc85\udcb9\udce4c\udc86\u001f\udcd0"], "users": ["test"], "verb": "rewritten"}]
+  | x  0dec01379d3b [{"markers": [["\r\udcec\u00017\udc9d;\udce61\udc8cG\u000e\udcad1\udcb1\udcfez\udce7\udccbS\udcd5", ["\udcebZ\r\udcaa!\udc92;\udcbf\udc8c\udcae\udcb2\udcc4 \udc85\udcb9\udce4c\udc86\u001f\udcd0"], 0, [["ef1", "13"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"], "users": ["test"], "verb": "rewritten"}]
   | |
-  | x  471f378eab4c [{"markers": [["G\u001f7\udc8e\udcabL^%\udcf6\udcc7\u007fx['\udcc96\udcef\udcb2(t", ["\udcebZ\r\udcaa!\udc92;\udcbf\udc8c\udcae\udcb2\udcc4 \udc85\udcb9\udce4c\udc86\u001f\udcd0"], 0, [["ef1", "9"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["\udcebZ\r\udcaa!\udc92;\udcbf\udc8c\udcae\udcb2\udcc4 \udc85\udcb9\udce4c\udc86\u001f\udcd0"], "users": ["test"], "verb": "rewritten"}]
+  | x  471f378eab4c [{"markers": [["G\u001f7\udc8e\udcabL^%\udcf6\udcc7\u007fx['\udcc96\udcef\udcb2(t", ["\udcebZ\r\udcaa!\udc92;\udcbf\udc8c\udcae\udcb2\udcc4 \udc85\udcb9\udce4c\udc86\u001f\udcd0"], 0, [["ef1", "9"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"], "users": ["test"], "verb": "rewritten"}]
   |/
   o  ea207398892e ""
   
@@ -736,11 +736,11 @@
   $ hg fatelogjson --hidden
   o  019fadeab383 ""
   |
-  | x  65b757b745b9 [{"markers": [["e\udcb7W\udcb7E\udcb95\t\u003c\udc87\udca2\udcbc\u0347u!\udccc\udccf\udcfc\udcbd", ["\u0001\udc9f\udcad\uacc3\udcf6i\udc9f\udca8:\u05fd\udcb4\udcd8.\udcd2\udcc0\udce5\udcab"], 0, [["ef1", "1"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["\u0001\udc9f\udcad\uacc3\udcf6i\udc9f\udca8:\u05fd\udcb4\udcd8.\udcd2\udcc0\udce5\udcab"], "users": ["test"], "verb": "rewritten"}]
+  | x  65b757b745b9 [{"markers": [["e\udcb7W\udcb7E\udcb95\t\u003c\udc87\udca2\udcbc\u0347u!\udccc\udccf\udcfc\udcbd", ["\u0001\udc9f\udcad\uacc3\udcf6i\udc9f\udca8:\u05fd\udcb4\udcd8.\udcd2\udcc0\udce5\udcab"], 0, [["ef1", "1"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["019fadeab383f6699fa83ad7bdb4d82ed2c0e5ab"], "users": ["test"], "verb": "rewritten"}]
   |/
   | @  fdf9bde5129a ""
   |/
-  | x  471f378eab4c [{"markers": [["G\u001f7\udc8e\udcabL^%\udcf6\udcc7\u007fx['\udcc96\udcef\udcb2(t", ["\udcfd\udcf9\udcbd\udce5\u0012\udc9a(\udcd4T\udc8f\udcad\udcd3\udcf6+&\\\udcdd;z."], 0, [["ef1", "1"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["\udcfd\udcf9\udcbd\udce5\u0012\udc9a(\udcd4T\udc8f\udcad\udcd3\udcf6+&\\\udcdd;z."], "users": ["test"], "verb": "rewritten"}, {"markers": [["G\u001f7\udc8e\udcabL^%\udcf6\udcc7\u007fx['\udcc96\udcef\udcb2(t", ["e\udcb7W\udcb7E\udcb95\t\u003c\udc87\udca2\udcbc\u0347u!\udccc\udccf\udcfc\udcbd"], 0, [["ef1", "1"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["e\udcb7W\udcb7E\udcb95\t\u003c\udc87\udca2\udcbc\u0347u!\udccc\udccf\udcfc\udcbd"], "users": ["test"], "verb": "rewritten"}]
+  | x  471f378eab4c [{"markers": [["G\u001f7\udc8e\udcabL^%\udcf6\udcc7\u007fx['\udcc96\udcef\udcb2(t", ["\udcfd\udcf9\udcbd\udce5\u0012\udc9a(\udcd4T\udc8f\udcad\udcd3\udcf6+&\\\udcdd;z."], 0, [["ef1", "1"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"], "users": ["test"], "verb": "rewritten"}, {"markers": [["G\u001f7\udc8e\udcabL^%\udcf6\udcc7\u007fx['\udcc96\udcef\udcb2(t", ["e\udcb7W\udcb7E\udcb95\t\u003c\udc87\udca2\udcbc\u0347u!\udccc\udccf\udcfc\udcbd"], 0, [["ef1", "1"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["65b757b745b935093c87a2bccd877521cccffcbd"], "users": ["test"], "verb": "rewritten"}]
   |/
   o  ea207398892e ""
   
@@ -949,11 +949,11 @@
   $ hg fatelogjson --hidden
   @  eb5a0daa2192 ""
   |
-  | x  b7ea6d14e664 [{"markers": [["\udcb7\udceam\u0014\udce6d\udcbd\u0212\"!\udcf7\udc99&1\udcb5\r\udca3\udcfb\u0007", ["\udcebZ\r\udcaa!\udc92;\udcbf\udc8c\udcae\udcb2\udcc4 \udc85\udcb9\udce4c\udc86\u001f\udcd0"], 0, [["ef1", "13"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["\udcebZ\r\udcaa!\udc92;\udcbf\udc8c\udcae\udcb2\udcc4 \udc85\udcb9\udce4c\udc86\u001f\udcd0"], "users": ["test"], "verb": "rewritten"}]
+  | x  b7ea6d14e664 [{"markers": [["\udcb7\udceam\u0014\udce6d\udcbd\u0212\"!\udcf7\udc99&1\udcb5\r\udca3\udcfb\u0007", ["\udcebZ\r\udcaa!\udc92;\udcbf\udc8c\udcae\udcb2\udcc4 \udc85\udcb9\udce4c\udc86\u001f\udcd0"], 0, [["ef1", "13"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"], "users": ["test"], "verb": "rewritten"}]
   | |
-  | | x  0dec01379d3b [{"markers": [["\r\udcec\u00017\udc9d;\udce61\udc8cG\u000e\udcad1\udcb1\udcfez\udce7\udccbS\udcd5", ["\udcb7\udceam\u0014\udce6d\udcbd\u0212\"!\udcf7\udc99&1\udcb5\r\udca3\udcfb\u0007"], 0, [["ef1", "1"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["\udcb7\udceam\u0014\udce6d\udcbd\u0212\"!\udcf7\udc99&1\udcb5\r\udca3\udcfb\u0007"], "users": ["test"], "verb": "rewritten"}]
+  | | x  0dec01379d3b [{"markers": [["\r\udcec\u00017\udc9d;\udce61\udc8cG\u000e\udcad1\udcb1\udcfez\udce7\udccbS\udcd5", ["\udcb7\udceam\u0014\udce6d\udcbd\u0212\"!\udcf7\udc99&1\udcb5\r\udca3\udcfb\u0007"], 0, [["ef1", "1"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["b7ea6d14e664bdc8922221f7992631b50da3fb07"], "users": ["test"], "verb": "rewritten"}]
   | |/
-  | x  471f378eab4c [{"markers": [["G\u001f7\udc8e\udcabL^%\udcf6\udcc7\u007fx['\udcc96\udcef\udcb2(t", ["\udcebZ\r\udcaa!\udc92;\udcbf\udc8c\udcae\udcb2\udcc4 \udc85\udcb9\udce4c\udc86\u001f\udcd0"], 0, [["ef1", "9"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["\udcebZ\r\udcaa!\udc92;\udcbf\udc8c\udcae\udcb2\udcc4 \udc85\udcb9\udce4c\udc86\u001f\udcd0"], "users": ["test"], "verb": "rewritten"}]
+  | x  471f378eab4c [{"markers": [["G\u001f7\udc8e\udcabL^%\udcf6\udcc7\u007fx['\udcc96\udcef\udcb2(t", ["\udcebZ\r\udcaa!\udc92;\udcbf\udc8c\udcae\udcb2\udcc4 \udc85\udcb9\udce4c\udc86\u001f\udcd0"], 0, [["ef1", "9"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"], "users": ["test"], "verb": "rewritten"}]
   |/
   o  ea207398892e ""
   
@@ -1098,7 +1098,7 @@
   $ hg fatelogjson --hidden
   @  7a230b46bf61 ""
   |
-  | x  471f378eab4c [{"markers": [["G\u001f7\udc8e\udcabL^%\udcf6\udcc7\u007fx['\udcc96\udcef\udcb2(t", ["\udcfd\udcf9\udcbd\udce5\u0012\udc9a(\udcd4T\udc8f\udcad\udcd3\udcf6+&\\\udcdd;z."], 0, [["ef1", "1"], ["user", "test"]], [0.0, 0], null], ["\udcfd\udcf9\udcbd\udce5\u0012\udc9a(\udcd4T\udc8f\udcad\udcd3\udcf6+&\\\udcdd;z.", ["z#\u000bF\udcbfa\udce5\u000b00\udc8cl\udcfd{\udcd1&\udc9e\udcf5G\u0002"], 0, [["ef1", "1"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["z#\u000bF\udcbfa\udce5\u000b00\udc8cl\udcfd{\udcd1&\udc9e\udcf5G\u0002"], "users": ["test"], "verb": "rewritten"}]
+  | x  471f378eab4c [{"markers": [["G\u001f7\udc8e\udcabL^%\udcf6\udcc7\u007fx['\udcc96\udcef\udcb2(t", ["\udcfd\udcf9\udcbd\udce5\u0012\udc9a(\udcd4T\udc8f\udcad\udcd3\udcf6+&\\\udcdd;z."], 0, [["ef1", "1"], ["user", "test"]], [0.0, 0], null], ["\udcfd\udcf9\udcbd\udce5\u0012\udc9a(\udcd4T\udc8f\udcad\udcd3\udcf6+&\\\udcdd;z.", ["z#\u000bF\udcbfa\udce5\u000b00\udc8cl\udcfd{\udcd1&\udc9e\udcf5G\u0002"], 0, [["ef1", "1"], ["user", "test"]], [0.0, 0], null]], "max_date": [0.0, 0], "min_date": [0.0, 0], "successors": ["7a230b46bf61e50b30308c6cfd7bd1269ef54702"], "users": ["test"], "verb": "rewritten"}]
   |/
   o  ea207398892e ""