comparison mercurial/cmdutil.py @ 30724:ee47e951c6f9

commit: fix unmodified message detection for the "--- >8 ----" magic We need the raw editortext to be compared with the templatetext.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 06 Jan 2017 22:50:04 +0900
parents 32f160ceb99d
children 0fbb3a5c188e
comparison
equal deleted inserted replaced
30723:6ef9f32d76c6 30724:ee47e951c6f9
2770 repo.dirstate.write(tr) 2770 repo.dirstate.write(tr)
2771 pending = tr and tr.writepending() and repo.root 2771 pending = tr and tr.writepending() and repo.root
2772 2772
2773 editortext = repo.ui.edit(committext, ctx.user(), ctx.extra(), 2773 editortext = repo.ui.edit(committext, ctx.user(), ctx.extra(),
2774 editform=editform, pending=pending) 2774 editform=editform, pending=pending)
2775 text = editortext
2775 2776
2776 # strip away anything below this special string (used for editors that want 2777 # strip away anything below this special string (used for editors that want
2777 # to display the diff) 2778 # to display the diff)
2778 stripbelow = re.search(_linebelow, editortext, flags=re.MULTILINE) 2779 stripbelow = re.search(_linebelow, text, flags=re.MULTILINE)
2779 if stripbelow: 2780 if stripbelow:
2780 editortext = editortext[:stripbelow.start()] 2781 text = text[:stripbelow.start()]
2781 2782
2782 text = re.sub("(?m)^HG:.*(\n|$)", "", editortext) 2783 text = re.sub("(?m)^HG:.*(\n|$)", "", text)
2783 os.chdir(olddir) 2784 os.chdir(olddir)
2784 2785
2785 if finishdesc: 2786 if finishdesc:
2786 text = finishdesc(text) 2787 text = finishdesc(text)
2787 if not text.strip(): 2788 if not text.strip():