# HG changeset patch # User Pierre-Yves David # Date 1497629012 -7200 # Node ID 45f5dbb246845045ac0e5a4a1590fe731faef2e2 # Parent ee37ab3de5f7fbaec2617f3d18dab91b2e21c454 obsfate: display more data about direct prune markers This does not handle all cases, but this should handle the most common ones. diff -r ee37ab3de5f7 -r 45f5dbb24684 hgext3rd/evolve/templatekw.py --- a/hgext3rd/evolve/templatekw.py Fri Jun 16 17:58:17 2017 +0200 +++ b/hgext3rd/evolve/templatekw.py Fri Jun 16 18:03:32 2017 +0200 @@ -139,9 +139,25 @@ if successorssets == []: successorssets = [[]] - values = [] + succsmap = repo.obsstore.successors + fullsuccessorsets = [] # successor set + markers for sset in successorssets: - rawmarkers = obshistory.successorsetallmarkers(sset, pathcache) + if sset: + markers = obshistory.successorsetallmarkers(sset, pathcache) + fullsuccessorsets.append((sset, markers)) + else: + # XXX we do not catch all prune markers (eg rewritten then pruned) + # (fix me later) + foundany = False + for mark in succsmap.get(ctx.node(), ()): + if not mark[1]: + foundany = True + fullsuccessorsets.append((sset, [mark])) + if not foundany: + fullsuccessorsets.append(([], [])) + + values = [] + for sset, rawmarkers in fullsuccessorsets: raw = obshistory.preparesuccessorset(sset, rawmarkers) # As we can't do something like diff -r ee37ab3de5f7 -r 45f5dbb24684 tests/test-evolve-templates.t --- a/tests/test-evolve-templates.t Fri Jun 16 17:58:17 2017 +0200 +++ b/tests/test-evolve-templates.t Fri Jun 16 18:03:32 2017 +0200 @@ -167,7 +167,7 @@ | Fate: rewritten by test2 as d004c8f274b9 | | x f137d23bb3e1 - | | Fate: pruned + | | Fate: pruned by test1 | | | x 471f378eab4c |/ Successors: [a468dc9b3633] @@ -203,7 +203,7 @@ | Fate: rewritten by test2 as d004c8f274b9 | | x f137d23bb3e1 - | | Fate: pruned + | | Fate: pruned by test1 | | | x 471f378eab4c |/ Successors: [a468dc9b3633] @@ -225,7 +225,7 @@ |/ Obsfate: rewritten by test2 as d004c8f274b9 (at 2001-04-19 04:25 +0000) | | x f137d23bb3e1 - | | Obsfate: pruned + | | Obsfate: pruned by test1 (at 2009-02-13 23:31 +0000) | | | x 471f378eab4c |/ Obsfate: rewritten by test1 as a468dc9b3633 (at 2009-02-13 23:31 +0000) @@ -238,7 +238,7 @@ | | x a468dc9b3633 [{"markers": [["a468dc9b36338b14fdb7825f55ce3df4e71517ad", ["d004c8f274b9ec480a47a93c10dac5eee63adb78"], 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 f137d23bb3e1 [{"markers": [["f137d23bb3e11dc1daeb6264fac9cb2433782e15", [], 0, [["ef1", "0"], ["user", "test1"]], [1234567890.0, 0], ["471f378eab4c5e25f6c77f785b27c936efb22874"]]], "max_date": [1234567890.0, 0], "min_date": [1234567890.0, 0], "successors": [], "users": ["test1"], "verb": "pruned"}] | | | x 471f378eab4c [{"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"], 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"}] |/ @@ -1127,13 +1127,13 @@ (use 'hg evolve' to update to its parent successor) $ hg tlog @ 471f378eab4c - | Fate: pruned + | Fate: pruned by test | o ea207398892e $ hg fatelog -v @ 471f378eab4c - | Obsfate: pruned + | Obsfate: pruned by test (at 1970-01-01 00:00 +0000) | o ea207398892e