diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -883,13 +883,12 @@ class localrepository(repo.repository): if branchname: extra["branch"] = branchname - if use_dirstate: - lines = [line.rstrip() for line in text.rstrip().splitlines()] - while lines and not lines[0]: - del lines[0] - if not lines: - raise util.Abort(_("empty commit message")) - text = '\n'.join(lines) + lines = [line.rstrip() for line in text.rstrip().splitlines()] + while lines and not lines[0]: + del lines[0] + if not lines and use_dirstate: + raise util.Abort(_("empty commit message")) + text = '\n'.join(lines) n = self.changelog.add(mn, changed + removed, text, trp, p1, p2, user, date, extra) diff --git a/tests/test-convert-git.out b/tests/test-convert-git.out --- a/tests/test-convert-git.out +++ b/tests/test-convert-git.out @@ -10,10 +10,10 @@ 3 t3 2 t4.1 1 t4.2 0 Merge branch other -changeset: 5:c6d72c98aa00 +changeset: 5:4ab1af49a271 tag: tip -parent: 3:a18bdfccf429 -parent: 4:48cb5b72ce56 +parent: 3:0222ab0998d7 +parent: 4:5333c870e3c2 user: test date: Mon Jan 01 00:00:15 2007 +0000 files: a