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

login
register
mail settings
Submitter Yuya Nishihara
Date April 19, 2017, 3:56 p.m.
Message ID <dfc33a94e1e6050d82d6.1492617371@mimosa>
Download mbox | patch
Permalink /patch/20267/
State Accepted
Headers show

Comments

Yuya Nishihara - April 19, 2017, 3:56 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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().
Sean Farley - April 20, 2017, 5:07 p.m.
Yuya Nishihara <yuya@tcha.org> writes:

> # HG changeset patch
> # User Yuya Nishihara <yuya@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().

Seems fine to me.

Patch

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)