changeset 41818:b38c7304974f

absorb: let scmutil.cleanupnodes() take care of setting phase Differential Revision: https://phab.mercurial-scm.org/D6036
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 27 Feb 2019 16:34:58 -0800
parents c91321e86071
children b10bbbe995eb
files hgext/absorb.py
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/absorb.py	Wed Feb 27 16:33:15 2019 -0800
+++ b/hgext/absorb.py	Wed Feb 27 16:34:58 2019 -0800
@@ -848,10 +848,7 @@
         if self._useobsolete and self.ui.configbool('absorb', 'add-noise'):
             extra['absorb_source'] = ctx.hex()
         mctx = overlaycontext(memworkingcopy, ctx, parents, extra=extra)
-        # preserve phase
-        with mctx.repo().ui.configoverride({
-            ('phases', 'new-commit'): ctx.phase()}):
-            return mctx.commit()
+        return mctx.commit()
 
     @util.propertycache
     def _useobsolete(self):
@@ -862,7 +859,8 @@
         replacements = {k: ([v] if v is not None else [])
                         for k, v in self.replacemap.iteritems()}
         if replacements:
-            scmutil.cleanupnodes(self.repo, replacements, operation='absorb')
+            scmutil.cleanupnodes(self.repo, replacements, operation='absorb',
+                                 fixphase=True)
 
 def _parsechunk(hunk):
     """(crecord.uihunk or patch.recordhunk) -> (path, (a1, a2, [bline]))"""