# HG changeset patch # User Matt Mackall # Date 2009-05-14 18:21:17 # Node ID e84a8482c6f2f9e0887f51e42183145406a21df9 # Parent 72538f1909ecab538f1eaeacaaaf838c3e7d648a editor: move HG: filtering from ui to commiteditor diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -7,7 +7,7 @@ from node import hex, nullid, nullrev, short from i18n import _ -import os, sys, bisect, stat, errno +import os, sys, bisect, stat, errno, re import mdiff, bdiff, util, templater, patch, error, encoding import match as _match @@ -1252,6 +1252,7 @@ def commitforceeditor(repo, ctx, added, olddir = os.getcwd() os.chdir(repo.root) text = repo.ui.edit("\n".join(edittext), ctx.user()) + text = re.sub("(?m)^HG:.*\n", "", text) os.chdir(olddir) if not text.strip(): diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -324,7 +324,6 @@ class ui(object): f = open(name) t = f.read() f.close() - t = re.sub("(?m)^HG:.*\n", "", t) finally: os.unlink(name)