evolve: use ui.configoverride() instead of ui.backupconfig()
ui.configoverride() was added in hg 4.1.
--- 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())