Mercurial > hg
comparison tests/drawdag.py @ 44380:dda2341d6664
drawdag: abide by new createmarkers() API
The `obsolete.createmarkers()` API was changed in 6335c0de80fa
(obsolete: allow multiple predecessors in createmarkers, 2018-09-22)
to prefer its precursors input to be a tuple instead of a single
precursor. Let's fix `drawdag.py` to comply.
Differential Revision: https://phab.mercurial-scm.org/D8149
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 25 Feb 2020 12:41:35 -0800 |
parents | 2372284d9457 |
children | 59fa3890d40a |
comparison
equal
deleted
inserted
replaced
44379:ca82929e433d | 44380:dda2341d6664 |
---|---|
436 arg = args[1].strip() | 436 arg = args[1].strip() |
437 | 437 |
438 if cmd in (b'replace', b'rebase', b'amend'): | 438 if cmd in (b'replace', b'rebase', b'amend'): |
439 nodes = [getctx(m) for m in arg.split(b'->')] | 439 nodes = [getctx(m) for m in arg.split(b'->')] |
440 for i in range(len(nodes) - 1): | 440 for i in range(len(nodes) - 1): |
441 rels.append((nodes[i], (nodes[i + 1],))) | 441 rels.append(((nodes[i],), (nodes[i + 1],))) |
442 elif cmd in (b'split',): | 442 elif cmd in (b'split',): |
443 pre, succs = arg.split(b'->') | 443 pre, succs = arg.split(b'->') |
444 succs = succs.split(b',') | 444 succs = succs.split(b',') |
445 rels.append((getctx(pre), (getctx(s) for s in succs))) | 445 rels.append(((getctx(pre),), (getctx(s) for s in succs))) |
446 elif cmd in (b'prune',): | 446 elif cmd in (b'prune',): |
447 for n in arg.split(b','): | 447 for n in arg.split(b','): |
448 rels.append((getctx(n), ())) | 448 rels.append(((getctx(n),), ())) |
449 if rels: | 449 if rels: |
450 obsolete.createmarkers(repo, rels, date=(0, 0), operation=cmd) | 450 obsolete.createmarkers(repo, rels, date=(0, 0), operation=cmd) |