[PATCH] histedit: make --keep work more like graft and use default phase for copies

Augie Fackler raf at durin42.com
Sun Nov 27 19:58:51 EST 2016


> On Nov 27, 2016, at 7:38 PM, Pierre-Yves David <pierre-yves.david at ens-lyon.org> wrote:
> 
> here is my current understanding of the situation:
> 
>  Before this patch:
>  ------------------
> 
>  1) histedit was refusing to run on public changeset in all cases
>    (regardless of --keep usage)
> 
>  2) histedit was preserving the phrase of changeset it touch in all
>     cases: (draft → draft, secret → secret, public not allowed)
>     (note, this phase preserving behavior in all cases match rebase).
> 
>  This patch is doing two things:
>  -------------------------------
> 
>  a) allow histedit on public changeset if --keep is present,
> 
>  b) change histedit --keep to use 'new-commit' phase,
> 
> 
> As Augie pointed, the first change (allow public with --keep) make perfect sense.
> 
> On the other hand, I'm not sure about what's motivate (b). I'm not sure if there is an actual use case behind it or if it is just a reaction to histedit preserving the public phases.

Based on my (foggy, because it was over a week ago) recollection of the irc conversation I had with Mads, the intent of the patch was to use the new-commit phase only in the case of histediting a public change with —keep. That may be revisionist memory though based on this review thread though, so take it with a grain of salt.

> 
> In all cases, this behavior change regarding phase preservation is problematic for two reasons:
> 
> 1) consistency: rebase still preserve phase when --keep is used. I think it is important to have a consistent behavior between the two commands on this point.
> 
> 2) backward compatibility: it is likely that we currently have existing users of histedit at rely on the fact secret changesets stay secret with 'histedit --keep', changing that behavior would lead them to turn 'secret' content draft and risk to push/publish it by mistake after upgrading.

Fair point. Can I interest one of the two of you into drafting either a revised version of this patch or followups that can be landed at the same time that moves us to the following state:

histedit allows operation on public nodes with --keep, and uses the default phase for any public changes that got copied (“rewritten” but not really) by such a histedit, while preserving the rest?

(I’d also be a big fan of some changes that verify the current phase-preserving behavior for secret/draft, since it appears that we lack coverage on that entirely, which might even be a good zeroth step in a revised series.)

> Given these serious concerns and the fact they was 90 other patches ready to be accepted on top of it, I've dropped this one from hg-committed for now.




More information about the Mercurial-devel mailing list