##// END OF EJS Templates
commit: fix unmodified message detection for the "--- >8 ----" magic...
Yuya Nishihara -
r30724:ee47e951 default
parent child Browse files
Show More
@@ -2772,14 +2772,15 b' def commitforceeditor(repo, ctx, subs, f'
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:
@@ -712,6 +712,9 b' test that text below the --- >8 --- spec'
712 > EOF
712 > EOF
713 $ echo foo2 > foo2
713 $ echo foo2 > foo2
714 $ hg add foo2
714 $ hg add foo2
715 $ HGEDITOR="sh $TESTTMP/notouching.sh" hg ci
716 abort: commit message unchanged
717 [255]
715 $ HGEDITOR="sh $TESTTMP/lowercaseline.sh" hg ci
718 $ HGEDITOR="sh $TESTTMP/lowercaseline.sh" hg ci
716 first line
719 first line
717 HG: this is customized commit template
720 HG: this is customized commit template
General Comments 0
You need to be logged in to leave comments. Login now