comparison mercurial/cmdutil.py @ 8409:e84a8482c6f2

editor: move HG: filtering from ui to commiteditor
author Matt Mackall <mpm@selenic.com>
date Thu, 14 May 2009 13:21:17 -0500
parents 223000a687b0
children 4e1795cf6e94
comparison
equal deleted inserted replaced
8408:72538f1909ec 8409:e84a8482c6f2
5 # This software may be used and distributed according to the terms of the 5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2, incorporated herein by reference. 6 # GNU General Public License version 2, incorporated herein by reference.
7 7
8 from node import hex, nullid, nullrev, short 8 from node import hex, nullid, nullrev, short
9 from i18n import _ 9 from i18n import _
10 import os, sys, bisect, stat, errno 10 import os, sys, bisect, stat, errno, re
11 import mdiff, bdiff, util, templater, patch, error, encoding 11 import mdiff, bdiff, util, templater, patch, error, encoding
12 import match as _match 12 import match as _match
13 13
14 revrangesep = ':' 14 revrangesep = ':'
15 15
1250 edittext.append("") 1250 edittext.append("")
1251 # run editor in the repository root 1251 # run editor in the repository root
1252 olddir = os.getcwd() 1252 olddir = os.getcwd()
1253 os.chdir(repo.root) 1253 os.chdir(repo.root)
1254 text = repo.ui.edit("\n".join(edittext), ctx.user()) 1254 text = repo.ui.edit("\n".join(edittext), ctx.user())
1255 text = re.sub("(?m)^HG:.*\n", "", text)
1255 os.chdir(olddir) 1256 os.chdir(olddir)
1256 1257
1257 if not text.strip(): 1258 if not text.strip():
1258 raise util.Abort(_("empty commit message")) 1259 raise util.Abort(_("empty commit message"))
1259 1260