[PATCH 1 of 2] split: new extension to split changesets

Jun Wu quark at fb.com
Mon Jun 26 13:59:58 EDT 2017

Excerpts from Martin von Zweigbergk's message of 2017-06-26 09:47:22 -0700:
> On Sat, Jun 24, 2017 at 10:45 PM, Jun Wu <quark at fb.com> wrote:
> > + at command('^split',
> > +    [('r', 'rev', '', _("revision to split"), _('REV')),
> > +     ('', 'no-rebase', False, _('do not rebase descendants after split')),
> > +    ] + cmdutil.commitopts2,
> The default of False probably deserves a separate discussion.
> When allowunstable is not enabled, I think other commands ("commit
> --amend", "rebase", "histedit") currently simply fail if there are
> descendants of the rewritten commit, so we could make them rebase
> instead without breaking BC too much (not error out anymore is usually
> fine).

The "allowunstable" config literally reads "whether unstable changesets are
allowed or not", it's not directly related to "rebase" and should not affect
the flag here.
> When allowunstable *is* enabled, none of "hg commit --amend", "hg
> rebase", and "hg histedit" currently rebase by default. Unless we
> decide that we should change their defaults, I don't see why the
> default of "hg split" should be different. It's probably okay to
> change the default of those commands given that evolve is still
> experimental? (Although evolve is not required for using
> allowunstable, I'd be surprised if users set allowunstable without
> evolve enabled.)

I think one key difference between amend and split is, amend may introduce
conflicts if rebased, so it makes sense to not rebase by default. A user
may want to amend again and again until they feel comfortable to do the
rebase and face the conflicts.

"split" will never cause rebase conflicts since the last new changeset
should have exactly the same working copy content as the original changeset.
So it's more friendly to rebase by default. (same for part of histedit)

At Facebook, amend won't do an automatic rebase by default but split, fold
or metaedit will.

Since split, fold, metaedit are new commands, and amend is better not doing
a rebase, I think we don't have to BC anything.

More information about the Mercurial-devel mailing list