# HG changeset patch # User Martin von Zweigbergk # Date 1575916428 28800 # Node ID 93014d9726d5a8bbe7f9cf8e0a6d2d6034373cba # Parent e66ba12e5db3638577d9083f13cf169b27efd5a1 evolve: use ui.configoverride() instead of ui.backupconfig() ui.configoverride() was added in hg 4.1. diff -r e66ba12e5db3 -r 93014d9726d5 hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Mon Dec 09 10:43:04 2019 -0800 +++ b/hgext3rd/evolve/evolvecmd.py Mon Dec 09 10:33:48 2019 -0800 @@ -1022,16 +1022,14 @@ del extra[b'branch'] extra[b'rebase_source'] = orig.hex() - backup = repo.ui.backupconfig(b'phases', b'new-commit') - try: - targetphase = max(orig.phase(), phases.draft) - repo.ui.setconfig(b'phases', b'new-commit', targetphase, b'evolve') + targetphase = max(orig.phase(), phases.draft) + configoverride = repo.ui.configoverride({ + (b'phases', b'new-commit'): targetphase + }, source=b'evolve') + with configoverride: # Commit might fail if unresolved files exist - nodenew = repo.commit(text=commitmsg, user=orig.user(), - date=orig.date(), extra=extra) - finally: - repo.ui.restoreconfig(backup) - return nodenew + return repo.commit(text=commitmsg, user=orig.user(), + date=orig.date(), extra=extra) def _finalizerelocate(repo, orig, dest, nodenew, tr, category, evolvestate): destbookmarks = repo.nodebookmarks(dest.node())