histedit: allow fold+edit action

Thomas De Schampheleire patrickdepinguin+mercurial at gmail.com
Fri Dec 19 19:56:05 UTC 2014


Hi Augie,

Sorry for this late reply, I totally missed your answer...

On Fri, Dec 12, 2014 at 6:00 PM, Augie Fackler <raf at durin42.com> wrote:
> On Fri, Dec 12, 2014 at 02:38:12PM +0100, Thomas De Schampheleire wrote:
>> Hi,
>>
>> When using histedit, it regularly happens that I want to fold one
>> changeset with another one, then edit the result.
>>
>> For example, with following three revisions, I want to fold revision 3
>> into revision 1:
>>
>> 1  some change
>> 2  some unrelated change
>> 3  fix for first change
>>
>> Currently, as far as I can see, this is not possible in one step.
>> The workaround is to use two histedit sessions, the first one:
>>
>> pick 1  some change
>> fold 3  fix for first change
>> pick 2  some unrelated change
>>
>> The second one edits the combined revision:
>>
>> edit 1  some change + fix
>> pick 2  some unrelated change
>>
>>
>> I would like to be able to say 'fold+edit' in one step, something like:
>>
>> pick 1  some change
>> fold,edit 3  fix for first change
>> pick 2  some unrelated change
>>
>> In case there are multiple folds, one should be able to add edit on
>> any one of them, for example
>>
>> pick 1
>> fold 3
>> fold 4
>> fold,edit 5
>> pick 2
>>
>> or
>>
>> pick 1
>> fold 3
>> fold,edit 4
>> fold 5
>> pick 2
>>
>> or even
>>
>> pick 1
>> fold 3
>> fold,edit 4
>> fold,edit 5
>
> So, this one looks a little wonky to me. Why edit twice, when you're
> just going to fold them together anyway?

It could be that 5 cannot be folded directly, and the user wants to
make some preparation on the current state before attempting the next
fold...

>
>> pick 2
>>
>>
>> What do you think of such a feature?
>
> It's not a horrible idea.
>
>> Should I create a bug report for the request?
>
> Yes. Note that I don't personally have need of it, and doing it
> cleanly is probably going to be a bit convoluted (the code doesn't
> really have a spot for splicing this in to my memory).

I have just created bug #4478 for this:
http://bz.selenic.com/show_bug.cgi?id=4478

>
> You may also be interested in a feature I've been asked for in the
> past, but am deferring until changeset evolution is more ready (for
> consistency reasons): a command you could insert that would drop you
> into a working copy ready for using 'hg commit --amend'. For example:
>
> pick 1
> fold 4
> fold 5
> pause
> pick 2
> pick 3
>
> (where "pause" is a name I just pulled out of thin air. We'd pick
> something better/clearer when doing actual implementation.)
>
> It hasn't been done yet because things get kind of mushy around the
> edges when you allow the amending, as it kind of risks breaking things
> in strange ways. If you look around on the -devel archives you can
> probably find some of the discussion.

This feature is indeed similar to the last 'wonky' example; a pause
command would probably make the double edit redundant.

Best regards,
Thomas



More information about the Mercurial mailing list