--- a/hgext/histedit.py Wed Aug 13 22:22:24 2014 +0900
+++ b/hgext/histedit.py Thu Aug 14 15:21:48 2014 -0500
@@ -363,12 +363,7 @@
hg.update(repo, parent)
### prepare new commit data
commitopts = opts.copy()
- # username
- if ctx.user() == oldctx.user():
- username = ctx.user()
- else:
- username = ui.username()
- commitopts['user'] = username
+ commitopts['user'] = ctx.user()
# commit message
if opts.get('rollup'):
newmessage = ctx.description()
--- a/tests/run-tests.py Wed Aug 13 22:22:24 2014 +0900
+++ b/tests/run-tests.py Thu Aug 14 15:21:48 2014 -0500
@@ -1125,6 +1125,7 @@
self.stream.write('\nERROR: %s output changed\n' % test)
self.stream.write('!')
+ self.stream.flush()
iolock.release()
def addSuccess(self, test):
--- a/tests/test-histedit-fold.t Wed Aug 13 22:22:24 2014 +0900
+++ b/tests/test-histedit-fold.t Thu Aug 14 15:21:48 2014 -0500
@@ -213,6 +213,44 @@
check saving last-message.txt
$ cd ..
+ $ rm -r r
+
+folding preserves initial author
+--------------------------------
+
+ $ initrepo
+
+ $ hg ci --user "someone else" --amend --quiet
+
+tip before edit
+ $ hg log --rev .
+ changeset: 5:a00ad806cb55
+ tag: tip
+ user: someone else
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: f
+
+
+ $ hg histedit e860deea161a --commands - 2>&1 <<EOF | fixbundle
+ > pick e860deea161a e
+ > fold a00ad806cb55 f
+ > EOF
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+tip after edit
+ $ hg log --rev .
+ changeset: 4:698d4e8040a1
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: e
+
+
+ $ cd ..
+ $ rm -r r
folding and creating no new change doesn't break:
-------------------------------------------------