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.
ryanmce |
hg-reviewers |
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.
Lint Skipped |
Unit Tests Skipped |
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? |
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) |
Path | Packages | |||
---|---|---|---|---|
M | hgext/histedit.py (10 lines) | |||
M | tests/test-histedit-arguments.t (3 lines) | |||
M | tests/test-histedit-bookmark-motion.t (2 lines) | |||
M | tests/test-histedit-commute.t (2 lines) | |||
M | tests/test-histedit-edit.t (1 line) | |||
M | tests/test-histedit-obsolete.t (1 line) | |||
M | tests/test-histedit-outgoing.t (3 lines) |
# | # | ||||
# You can reorder changesets by reordering the lines | # You can reorder changesets by reordering the lines | ||||
# | # | ||||
# Commands: | # Commands: | ||||
# | # | ||||
# e, edit = use commit, but stop for amending | # e, edit = use commit, but stop for amending | ||||
# m, mess = edit commit message without changing commit content | # m, mess = edit commit message without changing commit content | ||||
# p, pick = use commit | # p, pick = use commit | ||||
# c, copy = copy (graft) a changeset from elsewhere | |||||
# d, drop = remove commit from history | # d, drop = remove commit from history | ||||
# f, fold = use commit, but combine it with the one above | # f, fold = use commit, but combine it with the one above | ||||
# r, roll = like fold, but discard this commit's description and date | # r, roll = like fold, but discard this commit's description and date | ||||
# | # | ||||
Run on a revision not ancestors of the current working directory. | Run on a revision not ancestors of the current working directory. | ||||
-------------------------------------------------------------------- | -------------------------------------------------------------------- | ||||
# | # | ||||
# You can reorder changesets by reordering the lines | # You can reorder changesets by reordering the lines | ||||
# | # | ||||
# Commands: | # Commands: | ||||
# | # | ||||
# e, edit = use commit, but stop for amending | # e, edit = use commit, but stop for amending | ||||
# m, mess = edit commit message without changing commit content | # m, mess = edit commit message without changing commit content | ||||
# p, pick = use commit | # p, pick = use commit | ||||
# c, copy = copy (graft) a changeset from elsewhere | |||||
# d, drop = remove commit from history | # d, drop = remove commit from history | ||||
# f, fold = use commit, but combine it with the one above | # f, fold = use commit, but combine it with the one above | ||||
# r, roll = like fold, but discard this commit's description and date | # r, roll = like fold, but discard this commit's description and date | ||||
# | # | ||||
Test --continue with --keep | Test --continue with --keep | ||||
$ hg strip -q -r . --config extensions.strip= | $ hg strip -q -r . --config extensions.strip= | ||||
# | # | ||||
# You can reorder changesets by reordering the lines | # You can reorder changesets by reordering the lines | ||||
# | # | ||||
# Commands: | # Commands: | ||||
# | # | ||||
# e, edit = use commit, but stop for amending | # e, edit = use commit, but stop for amending | ||||
# m, mess = edit commit message without changing commit content | # m, mess = edit commit message without changing commit content | ||||
# p, pick = use commit | # p, pick = use commit | ||||
# c, copy = copy (graft) a changeset from elsewhere | |||||
# d, drop = remove commit from history | # d, drop = remove commit from history | ||||
# f, fold = use commit, but combine it with the one above | # f, fold = use commit, but combine it with the one above | ||||
# r, roll = like fold, but discard this commit's description and date | # r, roll = like fold, but discard this commit's description and date | ||||
# | # | ||||
$ cd .. | $ cd .. |
# | # | ||||
# You can reorder changesets by reordering the lines | # You can reorder changesets by reordering the lines | ||||
# | # | ||||
# Commands: | # Commands: | ||||
# | # | ||||
# e, edit = use commit, but stop for amending | # e, edit = use commit, but stop for amending | ||||
# m, mess = edit commit message without changing commit content | # m, mess = edit commit message without changing commit content | ||||
# p, pick = use commit | # p, pick = use commit | ||||
# c, copy = copy (graft) a changeset from elsewhere | |||||
# d, drop = remove commit from history | # d, drop = remove commit from history | ||||
# f, fold = use commit, but combine it with the one above | # f, fold = use commit, but combine it with the one above | ||||
# r, roll = like fold, but discard this commit's description and date | # r, roll = like fold, but discard this commit's description and date | ||||
# | # | ||||
$ hg histedit 1 --commands - --verbose << EOF | grep histedit | $ hg histedit 1 --commands - --verbose << EOF | grep histedit | ||||
> pick 177f92b77385 2 c | > pick 177f92b77385 2 c | ||||
> drop d2ae7f538514 1 b | > drop d2ae7f538514 1 b | ||||
> pick 055a42cdd887 3 d | > pick 055a42cdd887 3 d | ||||
# | # | ||||
# You can reorder changesets by reordering the lines | # You can reorder changesets by reordering the lines | ||||
# | # | ||||
# Commands: | # Commands: | ||||
# | # | ||||
# e, edit = use commit, but stop for amending | # e, edit = use commit, but stop for amending | ||||
# m, mess = edit commit message without changing commit content | # m, mess = edit commit message without changing commit content | ||||
# p, pick = use commit | # p, pick = use commit | ||||
# c, copy = copy (graft) a changeset from elsewhere | |||||
# d, drop = remove commit from history | # d, drop = remove commit from history | ||||
# f, fold = use commit, but combine it with the one above | # f, fold = use commit, but combine it with the one above | ||||
# r, roll = like fold, but discard this commit's description and date | # r, roll = like fold, but discard this commit's description and date | ||||
# | # | ||||
$ hg histedit 1 --commands - --verbose << EOF | grep histedit | $ hg histedit 1 --commands - --verbose << EOF | grep histedit | ||||
> pick b346ab9a313d 1 c | > pick b346ab9a313d 1 c | ||||
> pick cacdfd884a93 3 f | > pick cacdfd884a93 3 f | ||||
> pick 59d9f330561f 2 d | > pick 59d9f330561f 2 d |
# | # | ||||
# You can reorder changesets by reordering the lines | # You can reorder changesets by reordering the lines | ||||
# | # | ||||
# Commands: | # Commands: | ||||
# | # | ||||
# e, edit = use commit, but stop for amending | # e, edit = use commit, but stop for amending | ||||
# m, mess = edit commit message without changing commit content | # m, mess = edit commit message without changing commit content | ||||
# p, pick = use commit | # p, pick = use commit | ||||
# c, copy = copy (graft) a changeset from elsewhere | |||||
# d, drop = remove commit from history | # d, drop = remove commit from history | ||||
# f, fold = use commit, but combine it with the one above | # f, fold = use commit, but combine it with the one above | ||||
# r, roll = like fold, but discard this commit's description and date | # r, roll = like fold, but discard this commit's description and date | ||||
# | # | ||||
edit the history | edit the history | ||||
(use a hacky editor to check histedit-last-edit.txt backup) | (use a hacky editor to check histedit-last-edit.txt backup) | ||||
# | # | ||||
# You can reorder changesets by reordering the lines | # You can reorder changesets by reordering the lines | ||||
# | # | ||||
# Commands: | # Commands: | ||||
# | # | ||||
# e, edit = use commit, but stop for amending | # e, edit = use commit, but stop for amending | ||||
# m, mess = edit commit message without changing commit content | # m, mess = edit commit message without changing commit content | ||||
# p, pick = use commit | # p, pick = use commit | ||||
# c, copy = copy (graft) a changeset from elsewhere | |||||
# d, drop = remove commit from history | # d, drop = remove commit from history | ||||
# f, fold = use commit, but combine it with the one above | # f, fold = use commit, but combine it with the one above | ||||
# r, roll = like fold, but discard this commit's description and date | # r, roll = like fold, but discard this commit's description and date | ||||
# | # | ||||
should also work if a commit message is missing | should also work if a commit message is missing | ||||
$ BUNDLE="$TESTDIR/missing-comment.hg" | $ BUNDLE="$TESTDIR/missing-comment.hg" | ||||
$ hg init missing | $ hg init missing |
# | # | ||||
# You can reorder changesets by reordering the lines | # You can reorder changesets by reordering the lines | ||||
# | # | ||||
# Commands: | # Commands: | ||||
# | # | ||||
# e, edit = use commit, but stop for amending | # e, edit = use commit, but stop for amending | ||||
# m, mess = edit commit message without changing commit content | # m, mess = edit commit message without changing commit content | ||||
# p, fold = use commit | # p, fold = use commit | ||||
# c, copy = copy (graft) a changeset from elsewhere | |||||
# d, drop = remove commit from history | # d, drop = remove commit from history | ||||
# f, fold = use commit, but combine it with the one above | # f, fold = use commit, but combine it with the one above | ||||
# r, roll = like fold, but discard this commit's description and date | # r, roll = like fold, but discard this commit's description and date | ||||
# | # |
# | # | ||||
# You can reorder changesets by reordering the lines | # You can reorder changesets by reordering the lines | ||||
# | # | ||||
# Commands: | # Commands: | ||||
# | # | ||||
# e, edit = use commit, but stop for amending | # e, edit = use commit, but stop for amending | ||||
# m, mess = edit commit message without changing commit content | # m, mess = edit commit message without changing commit content | ||||
# p, pick = use commit | # p, pick = use commit | ||||
# c, copy = copy (graft) a changeset from elsewhere | |||||
# d, drop = remove commit from history | # d, drop = remove commit from history | ||||
# f, fold = use commit, but combine it with the one above | # f, fold = use commit, but combine it with the one above | ||||
# r, roll = like fold, but discard this commit's description and date | # r, roll = like fold, but discard this commit's description and date | ||||
# | # | ||||
$ hg histedit 1 --commands - --verbose <<EOF | grep histedit | $ hg histedit 1 --commands - --verbose <<EOF | grep histedit | ||||
> pick 177f92b77385 2 c | > pick 177f92b77385 2 c | ||||
> drop d2ae7f538514 1 b | > drop d2ae7f538514 1 b | ||||
> pick 055a42cdd887 3 d | > pick 055a42cdd887 3 d |
# | # | ||||
# You can reorder changesets by reordering the lines | # You can reorder changesets by reordering the lines | ||||
# | # | ||||
# Commands: | # Commands: | ||||
# | # | ||||
# e, edit = use commit, but stop for amending | # e, edit = use commit, but stop for amending | ||||
# m, mess = edit commit message without changing commit content | # m, mess = edit commit message without changing commit content | ||||
# p, pick = use commit | # p, pick = use commit | ||||
# c, copy = copy (graft) a changeset from elsewhere | |||||
# d, drop = remove commit from history | # d, drop = remove commit from history | ||||
# f, fold = use commit, but combine it with the one above | # f, fold = use commit, but combine it with the one above | ||||
# r, roll = like fold, but discard this commit's description and date | # r, roll = like fold, but discard this commit's description and date | ||||
# | # | ||||
$ cd .. | $ cd .. | ||||
show the error from unrelated repos | show the error from unrelated repos | ||||
$ cd r3 | $ cd r3 | ||||
# | # | ||||
# You can reorder changesets by reordering the lines | # You can reorder changesets by reordering the lines | ||||
# | # | ||||
# Commands: | # Commands: | ||||
# | # | ||||
# e, edit = use commit, but stop for amending | # e, edit = use commit, but stop for amending | ||||
# m, mess = edit commit message without changing commit content | # m, mess = edit commit message without changing commit content | ||||
# p, pick = use commit | # p, pick = use commit | ||||
# c, copy = copy (graft) a changeset from elsewhere | |||||
# d, drop = remove commit from history | # d, drop = remove commit from history | ||||
# f, fold = use commit, but combine it with the one above | # f, fold = use commit, but combine it with the one above | ||||
# r, roll = like fold, but discard this commit's description and date | # r, roll = like fold, but discard this commit's description and date | ||||
# | # | ||||
$ cd .. | $ cd .. | ||||
test sensitivity to branch in URL: | test sensitivity to branch in URL: | ||||
# | # | ||||
# You can reorder changesets by reordering the lines | # You can reorder changesets by reordering the lines | ||||
# | # | ||||
# Commands: | # Commands: | ||||
# | # | ||||
# e, edit = use commit, but stop for amending | # e, edit = use commit, but stop for amending | ||||
# m, mess = edit commit message without changing commit content | # m, mess = edit commit message without changing commit content | ||||
# p, pick = use commit | # p, pick = use commit | ||||
# c, copy = copy (graft) a changeset from elsewhere | |||||
# d, drop = remove commit from history | # d, drop = remove commit from history | ||||
# f, fold = use commit, but combine it with the one above | # f, fold = use commit, but combine it with the one above | ||||
# r, roll = like fold, but discard this commit's description and date | # r, roll = like fold, but discard this commit's description and date | ||||
# | # | ||||
test to check number of roots in outgoing revisions | test to check number of roots in outgoing revisions | ||||
$ hg -q outgoing -G --template '{node|short}({branch})' '../r' | $ hg -q outgoing -G --template '{node|short}({branch})' '../r' |
The formatting looks one space off here.