legacy: fix debugrecordpruneparents to call obsstore.create() with keywords stable
authorYuya Nishihara <yuya@tcha.org>
Thu, 20 Apr 2017 00:21:13 +0900
branchstable
changeset 2273 228111491788
parent 2272 eb47d436cdc3
child 2274 72ba9d4418e0
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().
README
hgext3rd/evolve/legacy.py
--- a/README	Wed Apr 19 21:17:43 2017 +0900
+++ b/README	Thu Apr 20 00:21:13 2017 +0900
@@ -117,6 +117,7 @@
 -------------------
 
  - template: adapt to change in 4.2
+ - fix 'debugrecordpruneparents' (outdated API usage)
 
 6.0.0 -- 2017-02-31
 -------------------
--- a/hgext3rd/evolve/legacy.py	Wed Apr 19 21:17:43 2017 +0900
+++ b/hgext3rd/evolve/legacy.py	Thu Apr 20 00:21:13 2017 +0900
@@ -192,8 +192,8 @@
                     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)