# HG changeset patch # User Martin von Zweigbergk # Date 1520628350 28800 # Node ID cc2bfc7d53620840733249fb41f5c08a018942f1 # Parent 9457c395fcbbaf9e7439785d7438fb4d9f7ff2c8 rebase: also restore "ui.allowemptycommit" value It looks like this was lost when the code was converted to the ui.configoverride() context manager in f255b1811f5e (rebase: get rid of ui.backupconfig, 2017-03-16). (And then the bad example was duplicated in 228916ca12b5 (rebase: add concludememorynode(), and call it when rebasing in-memory, 2017-12-07).) Differential Revision: https://phab.mercurial-scm.org/D2760 diff -r 9457c395fcbb -r cc2bfc7d5362 hgext/rebase.py --- a/hgext/rebase.py Thu Mar 08 14:17:24 2018 -0800 +++ b/hgext/rebase.py Fri Mar 09 12:45:50 2018 -0800 @@ -1054,9 +1054,9 @@ destphase = max(ctx.phase(), phases.draft) overrides = {('phases', 'new-commit'): destphase} + if keepbranch: + overrides[('ui', 'allowemptycommit')] = True with repo.ui.configoverride(overrides, 'rebase'): - if keepbranch: - repo.ui.setconfig('ui', 'allowemptycommit', True) # Replicates the empty check in ``repo.commit``. if wctx.isempty() and not repo.ui.configbool('ui', 'allowemptycommit'): return None @@ -1096,9 +1096,9 @@ destphase = max(ctx.phase(), phases.draft) overrides = {('phases', 'new-commit'): destphase} + if keepbranch: + overrides[('ui', 'allowemptycommit')] = True with repo.ui.configoverride(overrides, 'rebase'): - if keepbranch: - repo.ui.setconfig('ui', 'allowemptycommit', True) # Commit might fail if unresolved files exist if date is None: date = ctx.date()