# HG changeset patch # User Matt Mackall # Date 2010-10-30 17:13:52 # Node ID 4ff61287bde233da9adcc303d7e650cc23bc902e # Parent fabe61418a532aecce18942f05bcf1b5ba507bc7 commit: handle missing newline on last commit comment diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -1356,7 +1356,7 @@ def commitforceeditor(repo, ctx, subs): olddir = os.getcwd() os.chdir(repo.root) text = repo.ui.edit("\n".join(edittext), ctx.user()) - text = re.sub("(?m)^HG:.*\n", "", text) + text = re.sub("(?m)^HG:.*(\n|$)", "", text) os.chdir(olddir) if not text.strip():