D6036: absorb: let scmutil.cleanupnodes() take care of setting phase

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Feb 27 19:40:10 EST 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/absorb.py

CHANGE DETAILS

diff --git a/hgext/absorb.py b/hgext/absorb.py
--- a/hgext/absorb.py
+++ b/hgext/absorb.py
@@ -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]))"""



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


More information about the Mercurial-devel mailing list