diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -857,6 +857,16 @@ def commiteditor(self): return cmdutil.getcommiteditor(edit=True, editform='histedit.mess') +@action(['copy', 'c'], + _('copy (graft) a changeset from elsewhere')) +class copy(histeditaction): + def _verifynodeconstraints(self, prev, expected, seen, basenodes): + pass + + def continueclean(self): + ctx, replacement = super(copy, self).continueclean() + return ctx, [] + def findoutgoing(ui, repo, remote=None, force=False, opts=None): """utility function to find the first outgoing changeset diff --git a/tests/test-histedit-arguments.t b/tests/test-histedit-arguments.t --- a/tests/test-histedit-arguments.t +++ b/tests/test-histedit-arguments.t @@ -70,6 +70,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # c, copy = copy (graft) a changeset from elsewhere # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -305,6 +306,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # c, copy = copy (graft) a changeset from elsewhere # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -541,6 +543,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # c, copy = copy (graft) a changeset from elsewhere # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-bookmark-motion.t b/tests/test-histedit-bookmark-motion.t --- a/tests/test-histedit-bookmark-motion.t +++ b/tests/test-histedit-bookmark-motion.t @@ -76,6 +76,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # c, copy = copy (graft) a changeset from elsewhere # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -132,6 +133,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # c, copy = copy (graft) a changeset from elsewhere # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-commute.t b/tests/test-histedit-commute.t --- a/tests/test-histedit-commute.t +++ b/tests/test-histedit-commute.t @@ -70,6 +70,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # c, copy = copy (graft) a changeset from elsewhere # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -348,6 +349,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # c, copy = copy (graft) a changeset from elsewhere # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t +++ b/tests/test-histedit-edit.t @@ -476,6 +476,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, fold = use commit + # c, copy = copy (graft) a changeset from elsewhere # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t --- a/tests/test-histedit-obsolete.t +++ b/tests/test-histedit-obsolete.t @@ -132,6 +132,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # c, copy = copy (graft) a changeset from elsewhere # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-outgoing.t b/tests/test-histedit-outgoing.t --- a/tests/test-histedit-outgoing.t +++ b/tests/test-histedit-outgoing.t @@ -52,6 +52,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # c, copy = copy (graft) a changeset from elsewhere # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -86,6 +87,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # c, copy = copy (graft) a changeset from elsewhere # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -112,6 +114,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # c, copy = copy (graft) a changeset from elsewhere # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date