# HG changeset patch # User Anton Shestakov # Date 1598022243 -28800 # Node ID 9242d0b5f74d34cff28b3e5f39b10efa302682dd # Parent da039e9be459ec0e06ddb88f8691e28bc7daf496 split: compatibility with cmdutil.revert() without parents argument `assert` is here because I'm not sure if this is enough, and we might not have tests that fail this specific assert. diff -r da039e9be459 -r 9242d0b5f74d hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Fri Aug 21 21:37:37 2020 +0800 +++ b/hgext3rd/evolve/cmdrewrite.py Fri Aug 21 23:04:03 2020 +0800 @@ -1308,6 +1308,13 @@ # prompting for confirmation ui.status(_(b'discarding remaining changes\n')) target = newcommits[0] + args = [] + kwargs = {} + code = cmdutil.revert.__code__ + # hg <= 5.5 (8c466bcb0879) + if r'parents' in code.co_varnames[:code.co_argcount]: + args.append((target, node.nullid)) + assert target.node() == repo.dirstate.p1() if pats: status = repo.status(match=matcher) dirty = set() @@ -1315,12 +1322,10 @@ dirty.update(status.added) dirty.update(status.removed) dirty.update(status.deleted) - dirty = sorted(dirty) - cmdutil.revert(ui, repo, repo[target], - (target, node.nullid), *dirty) + args += sorted(dirty) else: - cmdutil.revert(ui, repo, repo[target], - (target, node.nullid), all=True) + kwargs[r'all'] = True + cmdutil.revert(ui, repo, repo[target], *args, **kwargs) elif nextaction == b'?': nextaction = None ui.write(_(b"y - yes, continue selection\n"))