diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -860,6 +860,13 @@ class localrepository(repo.repository): else: remove.append(f) + updated, added = [], [] + for f in util.sort(changed): + if f in m1 or f in m2: + updated.append(f) + else: + added.append(f) + # update manifest m1.update(new) removed = [] @@ -888,9 +895,10 @@ class localrepository(repo.repository): edittext.append("HG: branch merge") if branchname: edittext.append("HG: branch '%s'" % util.tolocal(branchname)) - edittext.extend(["HG: changed %s" % f for f in changed]) + edittext.extend(["HG: added %s" % f for f in added]) + edittext.extend(["HG: changed %s" % f for f in updated]) edittext.extend(["HG: removed %s" % f for f in removed]) - if not changed and not remove: + if not added and not updated and not removed: edittext.append("HG: no files changed") edittext.append("") # run editor in the repository root diff --git a/tests/test-commit b/tests/test-commit --- a/tests/test-commit +++ b/tests/test-commit @@ -106,5 +106,21 @@ echo % should fail because we are specif hg ci -mmerge -I a echo % should succeed hg ci -mmerge +cd .. + + +echo % test commit message content +hg init commitmsg +cd commitmsg +echo changed > changed +echo removed > removed +hg ci -qAm init + +hg rm removed +echo changed >> changed +echo added > added +hg add added +HGEDITOR=cat hg ci -A +cd .. exit 0 diff --git a/tests/test-commit.out b/tests/test-commit.out --- a/tests/test-commit.out +++ b/tests/test-commit.out @@ -106,3 +106,16 @@ abort: cannot partially commit a merge ( % should fail because we are specifying a pattern abort: cannot partially commit a merge (do not specify files or patterns) % should succeed +% test commit message content + + +HG: Enter commit message. Lines beginning with 'HG:' are removed. +HG: -- +HG: user: test +HG: branch 'default' +HG: added added +HG: changed changed +HG: removed removed +transaction abort! +rollback completed +abort: empty commit message