D3818: scmutil: make cleanupnodes optionally also fix the phase

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Jun 21 11:15:56 EDT 2018


martinvonz added a comment.


  In https://phab.mercurial-scm.org/D3818#59722, @yuja wrote:
  
  > Queued, thanks.
  >
  > > +            ctx = unfi[newnode]
  > >  +            if targetphase is None:
  > >  +                oldphase = max(unfi[oldnode].phase()
  > >  +                               for oldnode in precursors[newnode])
  > >  +                parentphase = max(phase(p) for p in ctx.parents())
  > >  +                newphase = max(oldphase, parentphase)
  > >  +            else:
  > >  +                newphase = targetphase
  >
  > Maybe better to do `max(targetphase, parentphase)`?
  >
  > I think it can be a source of bug that the targetphase may advance ancestors
  >  to public/draft.
  
  
  Oh, I definitely agree. Good catch. Will send a followup.

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: quark, mharbison72, yuja, mercurial-devel


More information about the Mercurial-devel mailing list