--- a/tests/test-evolve.t Mon Apr 25 16:24:42 2016 -0700
+++ b/tests/test-evolve.t Mon Apr 25 16:24:42 2016 -0700
@@ -2,6 +2,7 @@
> [defaults]
> amend=-d "0 0"
> fold=-d "0 0"
+ > metaedit=-d "0 0"
> [web]
> push_ssl = false
> allow_push = *
@@ -1457,3 +1458,67 @@
$ hg status newlyadded
A newlyadded
+
+hg metaedit
+-----------
+
+ $ hg update --clean .
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm newlyadded
+ $ hg metaedit -r 0
+ abort: cannot edit commit information for public revisions
+ [255]
+check that metaedit respects allowunstable
+ $ hg metaedit '.^' --config 'experimental.evolution=createmarkers, allnewcommands'
+ abort: cannot edit commit information in the middle of a stack
+ (c904da5245b0 will be affected)
+ [255]
+ $ hg metaedit --user foobar
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg log --template '{rev}: {author}\n' -r '42:' --hidden
+ 42: test
+ 43: foobar
+ $ hg log --template '{rev}: {author}\n' -r .
+ 43: foobar
+
+TODO: support this
+ $ hg metaedit '.^::.'
+ abort: editing multiple revisions is not currently supported
+ [255]
+
+no new commit is created here because the date is the same
+ $ HGEDITOR=cat hg metaedit
+ will be evolved safely
+
+
+ HG: Enter commit message. Lines beginning with 'HG:' are removed.
+ HG: Leave message empty to abort commit.
+ HG: --
+ HG: user: foobar
+ HG: branch 'default'
+ HG: changed a
+ nothing changed
+
+ $ glog -r '.^::.'
+ @ 43:62353add3dfb@default(draft) will be evolved safely
+ |
+ o 41:34ae045ec400@default(draft) amended
+ |
+ ~
+
+TODO: don't create a new commit in this case
+ $ hg metaedit --config defaults.metaedit=
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg log -r '.^::.' --template '{rev}: {desc|firstline}\n'
+ 41: amended
+ 44: will be evolved safely
+
+ $ hg up .^
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg metaedit --user foobar2 44
+ $ hg log --template '{rev}: {author}\n' -r '42:' --hidden
+ 42: test
+ 43: foobar
+ 44: foobar
+ 45: foobar2
+ $ hg diff -r 44 -r 45 --hidden