# HG changeset patch # User Thomas Arendsen Hein # Date 2007-12-28 16:10:25 # Node ID c5793dada959ddd46b6bb301fd07d2b004706267 # Parent 6183df642f95f0b076221ad8e721ad684cecd7d9 Clarify some messages during commit: - use "branch 'foo'" to distinguish from "branch merge". - commit messags can be empty (to abort commits) - Added value for editor message: Tell about HG: lines like CVS does. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -799,13 +799,14 @@ class localrepository(repo.repository): if text: edittext.append(text) edittext.append("") - edittext.append(_("HG: Please write and save a commit message")) + edittext.append(_("HG: Enter commit message." + " Lines beginning with 'HG:' are removed.")) edittext.append("HG: --") edittext.append("HG: user: %s" % user) if p2 != nullid: edittext.append("HG: branch merge") if branchname: - edittext.append("HG: branch %s" % util.tolocal(branchname)) + edittext.append("HG: branch '%s'" % util.tolocal(branchname)) edittext.extend(["HG: changed %s" % f for f in changed]) edittext.extend(["HG: removed %s" % f for f in removed]) if not changed and not remove: @@ -825,7 +826,7 @@ class localrepository(repo.repository): while lines and not lines[0]: del lines[0] if not lines: - raise util.Abort(_("commit message cannot be left blank")) + raise util.Abort(_("empty commit message")) text = '\n'.join(lines) n = self.changelog.add(mn, changed + removed, text, trp, p1, p2, diff --git a/tests/test-commit.out b/tests/test-commit.out --- a/tests/test-commit.out +++ b/tests/test-commit.out @@ -1,7 +1,7 @@ % commit date test transaction abort! rollback completed -abort: commit message cannot be left blank +abort: empty commit message transaction abort! rollback completed abort: impossible time zone offset: 4444444 diff --git a/tests/test-import.out b/tests/test-import.out --- a/tests/test-import.out +++ b/tests/test-import.out @@ -22,7 +22,7 @@ 2 files updated, 0 files merged, 0 files applying ../tip.patch transaction abort! rollback completed -abort: commit message cannot be left blank +abort: empty commit message % import of plain diff should be ok with message requesting all changes adding changesets @@ -92,7 +92,7 @@ 2 files updated, 0 files merged, 0 files applying patch from stdin transaction abort! rollback completed -abort: commit message cannot be left blank +abort: empty commit message % hg export in email, should use patch header requesting all changes adding changesets diff --git a/tests/test-record.out b/tests/test-record.out --- a/tests/test-record.out +++ b/tests/test-record.out @@ -50,7 +50,7 @@ diff --git a/empty-rw b/empty-rw new file mode 100644 examine changes to 'empty-rw'? [Ynsfdaq?] transaction abort! rollback completed -abort: commit message cannot be left blank +abort: empty commit message changeset: -1:000000000000 tag: tip