equal
deleted
inserted
replaced
801 if (not empty_ok and not text) or force_editor: |
801 if (not empty_ok and not text) or force_editor: |
802 edittext = [] |
802 edittext = [] |
803 if text: |
803 if text: |
804 edittext.append(text) |
804 edittext.append(text) |
805 edittext.append("") |
805 edittext.append("") |
|
806 edittext.append(_("HG: Please write and save a commit message")) |
|
807 edittext.append("HG: --") |
806 edittext.append("HG: user: %s" % user) |
808 edittext.append("HG: user: %s" % user) |
807 if p2 != nullid: |
809 if p2 != nullid: |
808 edittext.append("HG: branch merge") |
810 edittext.append("HG: branch merge") |
809 if branchname: |
811 if branchname: |
810 edittext.append("HG: branch %s" % util.tolocal(branchname)) |
812 edittext.append("HG: branch %s" % util.tolocal(branchname)) |
825 if use_dirstate: |
827 if use_dirstate: |
826 lines = [line.rstrip() for line in text.rstrip().splitlines()] |
828 lines = [line.rstrip() for line in text.rstrip().splitlines()] |
827 while lines and not lines[0]: |
829 while lines and not lines[0]: |
828 del lines[0] |
830 del lines[0] |
829 if not lines: |
831 if not lines: |
830 return None |
832 raise util.Abort(_("commit message cannot be left blank")) |
831 text = '\n'.join(lines) |
833 text = '\n'.join(lines) |
832 |
834 |
833 n = self.changelog.add(mn, changed + removed, text, trp, p1, p2, |
835 n = self.changelog.add(mn, changed + removed, text, trp, p1, p2, |
834 user, date, extra) |
836 user, date, extra) |
835 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1, |
837 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1, |