Patchwork D2760: rebase: also restore "ui.allowemptycommit" value

login
register
mail settings
Submitter phabricator
Date March 12, 2018, 6:22 p.m.
Message ID <af3a087a3614b55cce23415c9cd0c71d@localhost.localdomain>
Download mbox | patch
Permalink /patch/29315/
State Not Applicable
Headers show

Comments

phabricator - March 12, 2018, 6:22 p.m.
martinvonz updated this revision to Diff 6872.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2760?vs=6788&id=6872

REVISION DETAIL
  https://phab.mercurial-scm.org/D2760

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1053,9 +1053,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
@@ -1095,9 +1095,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()