[RFC] New core command: graft

Matt Mackall mpm at selenic.com
Mon Oct 10 12:55:39 CDT 2011


On Mon, 2011-10-10 at 19:16 +0200, Antoine Pitrou wrote:
> On Mon, 10 Oct 2011 12:00:59 -0500
> Matt Mackall <mpm at selenic.com> wrote:
> > On Mon, 2011-10-10 at 18:09 +0200, Antoine Pitrou wrote:
> > > On Sun, 09 Oct 2011 17:23:38 -0500
> > > Matt Mackall <mpm at selenic.com> wrote:
> > > > 
> > > > Among other things, I'm looking for feedback on the UI and what features
> > > > are critical. Right now, it copies the details of grafted changesets
> > > > (user/date/description) verbatim. That's an ok default, but it seems
> > > > like we'd like to be able to tweak that.
> > > 
> > > I think ability to edit the changeset message is a definite plus
> > > (sometimes you want to mention specific problems you had when doing the
> > > graft, or explain some differences between the two changesets).
> > > For me "hg graft" should not commit by default, because a patch
> > > applying fine is not enough to guarantee the result it actually ok. In
> > > our case (CPython) we want to compile and run the test suite before
> > > committing (at least the tests likely to be affected).
> > 
> > Which gets us back to 'original author/date/description are now lost'.
> 
> They are not if you keep track of the grafted changeset id, and display
> its id as part of repository-inspecting commands (such as hg log).
> Since you can only graft changesets from the same repo there shouldn't
> be any problem.

Ok.. so I type:

$ hg graft 15199
grafting changeset 15199
(don't forget to commit!)
$ hg commit

Where is the author/date/description/graft-origin stored between these
two commands? How does commit know to retrieve it? They're lost unless
we add a lot of new logic -outside- of the graft command.

How do we indicate to the user that their working directory is currently
in this new 'in the middle of a graft' state and their next commit will
finish the graft? How do we get out of this state? 

Making commit 'modal' like this introduces a lot more problems than it
solves.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list