This is an archive of the discontinued Mercurial Phabricator instance.

histedit: add copy histedit action
AbandonedPublic

Authored by mbthomas on Sep 26 2017, 6:14 AM.

Details

Reviewers
ryanmce
Group Reviewers
hg-reviewers
Summary

Add a new histedit action: copy. This allows copying of changesets from
outside of the history that is being edited, using the node hash of the other
changeset.

The other changeset is left intact - its contents are duplicated in a new
changeset.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

mbthomas created this revision.Sep 26 2017, 6:14 AM
ryanmce accepted this revision.Sep 26 2017, 7:38 AM
ryanmce added a subscriber: ryanmce.
ryanmce added inline comments.
hgext/histedit.py
861

The formatting looks one space off here.

durin42 added a subscriber: durin42.Oct 1 2017, 5:58 AM
durin42 added inline comments.
hgext/histedit.py
864

Shouldnt't we only allow copying things from outside the histedit stack?

mbthomas added inline comments.Oct 3 2017, 5:21 AM
hgext/histedit.py
864

I allowed copy to refer to things in the stack because it's conceivable you might want something from the stack twice. Thinking about it now, this is only actually useful if the base action is enabled (experimental.histeditng=true), in which case you could write something like:

pick 222
pick 111
base aaa
copy 222
copy 111

I could add a check that only fires if histeditng is disabled. Does that sound useful?

durin42 added inline comments.Oct 4 2017, 8:00 AM
hgext/histedit.py
864

Even better: make sure each change will only be applied once per resulting stack (that is, look for the base commands and then allow extra copy/pick commands afterwards, one per change.) Does that make sense? It doesn't actually need to be conditional on histeditng, it needs to be conditional on where the base statements are since a copy is necessarily duplicating a change (which is a conflict if it happens twice without a base)

mbthomas abandoned this revision.Oct 12 2017, 5:10 AM