Graft can't collapse and rebase --collapse does not record all metadata

Lawrence Stewart lstewart at room52.net
Wed Jan 28 00:38:11 UTC 2015


On 01/19/15 17:25, Lawrence Stewart wrote:
> Hi all,
> 
> I want to be able to cherry pick a related set of commits from our dev
> branch up to our prod branch, but collapse them into a single commit on
> the prod branch.
> 
> Graft allows me to apply them as individual commits which does the job
> but is overly verbose and not a great solution, especially when many
> commits are involved.
> 
> Rebase --collapse --keep -r <rev1> -r <rev2> -r <rev3> conceptually and
> practically does what I want, but does not record all of the revs in the
> extra meta data, only rebase_source=<rev3>. As such merge and rebase
> logic is unaware that <rev1> and <rev2> have been pulled up.
> 
> hg export | hg import can be used to apply multiple patches to the
> working copy and commit as a single commit, but obviously is gross and
> doesn't record any meta data at all which is bad.
> 
> I think what I would conceptually like is graft to grow a --collapse
> flag which would apply all revs on the graft command line to the working
> copy and then commit as one, also recording all revs in the metadata for
> the commit.
> 
> Is there already a canonical way to do what I'm talking about that I've
> missed, or would it be worthwhile opening a feature request against
> graft for a --collapse option?

Any further thoughts from the community?

Cheers,
Lawrence



More information about the Mercurial mailing list