equal
deleted
inserted
replaced
823 |
823 |
824 cctx = context.workingctx(self, (p1, p2), text, user, date, |
824 cctx = context.workingctx(self, (p1, p2), text, user, date, |
825 extra, changes) |
825 extra, changes) |
826 if editor: |
826 if editor: |
827 cctx._text = editor(self, cctx, subs) |
827 cctx._text = editor(self, cctx, subs) |
|
828 edited = (text != cctx._text) |
828 |
829 |
829 # commit subs |
830 # commit subs |
830 if subs: |
831 if subs: |
831 state = wctx.substate.copy() |
832 state = wctx.substate.copy() |
832 for s in subs: |
833 for s in subs: |
842 # makes testing easier.) |
843 # makes testing easier.) |
843 msgfile = self.opener('last-message.txt', 'w') |
844 msgfile = self.opener('last-message.txt', 'w') |
844 msgfile.write(cctx._text.rstrip() + '\n') |
845 msgfile.write(cctx._text.rstrip() + '\n') |
845 msgfile.close() |
846 msgfile.close() |
846 |
847 |
847 ret = self.commitctx(cctx, True) |
848 try: |
|
849 ret = self.commitctx(cctx, True) |
|
850 except: |
|
851 if edited: |
|
852 msgfn = self.pathto(msgfile.name[len(self.root)+1:]) |
|
853 self.ui.write( |
|
854 _('note: commit message saved in %s\n') % msgfn) |
|
855 raise |
848 |
856 |
849 # update dirstate and mergestate |
857 # update dirstate and mergestate |
850 for f in changes[0] + changes[1]: |
858 for f in changes[0] + changes[1]: |
851 self.dirstate.normal(f) |
859 self.dirstate.normal(f) |
852 for f in changes[2]: |
860 for f in changes[2]: |