Patchwork D7726: commitablectx: fix the default phase

login
register
mail settings
Submitter phabricator
Date Dec. 27, 2019, 4:01 p.m.
Message ID <differential-rev-PHID-DREV-s5n2twlae66uiqskodtd-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44048/
State Superseded
Headers show

Comments

phabricator - Dec. 27, 2019, 4:01 p.m.
marmoute created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The code was ignoring the config option. Since the config option will control
  the actual phase of the committed result, we better take it in account early.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1439,7 +1439,7 @@ 
         return b
 
     def phase(self):
-        phase = phases.draft  # default phase to draft
+        phase = phases.newcommitphase(self._repo.ui)
         for p in self.parents():
             phase = max(phase, p.phase())
         return phase