[PATCH] amend: preserve phase of amended revision (issue3602)

Idan Kamara idankk86 at gmail.com
Fri Aug 31 15:08:35 CDT 2012


On Fri, Aug 31, 2012 at 11:00 PM, Pierre-Yves David <
pierre-yves.david at ens-lyon.org> wrote:
>
>
> On 31 août 2012, at 21:48, Idan Kamara wrote:
>
> > On Fri, Aug 31, 2012 at 10:30 PM, Pierre-Yves David
> > <pierre-yves.david at ens-lyon.org> wrote:
> > >
> > > # HG changeset patch
> > > # User Pierre-Yves David <pierre-yves.david at logilab.fr>
> > > # Date 1346338028 -7200
> > > # Branch stable
> > > # Node ID ce6eb58850a45f6a20cd3cfa6320369cc0f66273
> > > # Parent  b0aad9fb87f947e821f0381d461f1794e73833a7
> > > amend: preserve phase of amended revision (issue3602)
> > >
> > > New commit from the amend process were created without any phase
> > > contraint. If
> > > the amended changeset had a different phase from it's parent, the
> > > phases
> > > data
> > > were lost.
> > >
> > > The changeset ensure the new commit are created in the same phase than
> > > the
> > > original changeset.
> >
> > It might nice to introduce a 'copycommitmetadata' utility function that
> > does this and everything else (user, message, date..) in one place.
>
> phase are not handled the same way that meta data. I'm not sure to see how
> this function would work ?

It would look at the source commit + an options dict and return
the appropriate metadata for the new commit.

>
> > A quick test reveals that graft doesn't copy phase info too.
>
> But graft is about "copying the diff of another changeset as new commit".
> It is  the same kind of operation than a plain new commit. So, graft honor
> current phase config *by design*.

Unless an explicit phase is specified when grafting, it seems to me like it
should use the phase of the source commit. Same thing when rebasing,
which already seems to preserve the phase.

I don't see a reason for --amend to behave differently.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120831/111afb93/attachment.html>


More information about the Mercurial-devel mailing list