[PATCH evolve-ext] legacy: fix debugrecordpruneparents to call obsstore.create() with keywords

Yuya Nishihara yuya at tcha.org
Wed Apr 19 15:56:11 UTC 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1492615273 -32400
#      Thu Apr 20 00:21:13 2017 +0900
# Branch stable
# Node ID dfc33a94e1e6050d82d6df47b2cffb997f37cbd5
# Parent  eb47d436cdc3bc6657d89baffe24fcd9abaf9e9c
legacy: fix debugrecordpruneparents to call obsstore.create() with keywords

It appears the API was changed twice in Mercurial at

 - 570f87422f54 "obsstore: add an explicit `date` argument to obsstore.create"
 - adb3798dce49 "obsstore: add a `parents` argument to obsstore.create"

and metadata would be changed to a list of (key, value) pairs. Convert it back
to a dict as expected by create().

diff --git a/hgext3rd/evolve/legacy.py b/hgext3rd/evolve/legacy.py
--- a/hgext3rd/evolve/legacy.py
+++ b/hgext3rd/evolve/legacy.py
@@ -192,8 +192,8 @@ def cmddebugrecordpruneparents(ui, repo)
                     ctx = unfi[rev]
                     parents = tuple(p.node() for p in ctx.parents())
                     before = len(store._all)
-                    store.create(tr, mark[0], mark[1], mark[2], mark[3],
-                                 parents=parents)
+                    store.create(tr, prec=mark[0], succs=mark[1], flag=mark[2],
+                                 metadata=dict(mark[3]), parents=parents)
                     if len(store._all) - before:
                         ui.write(_('created new markers for %i\n') % rev)
             ui.progress(pgop, idx, total=pgtotal)


More information about the Mercurial-devel mailing list