comparison mercurial/cmdutil.py @ 22205:9fa429723f26

ui: invoke editor for committing with HGEDITFORM environment variable At the external editor invocation for committing, the value specified as "editform" for "cmdutil.getcommiteditor" is in "HGEDITFORM". This enables external editor to do own customization according to commit types.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 15 Aug 2014 23:05:53 +0900
parents 55308ab8117c
children d3659b3795e9
comparison
equal deleted inserted replaced
22204:f8dc6599da5d 22205:9fa429723f26
2213 committext = buildcommittext(repo, ctx, subs, extramsg) 2213 committext = buildcommittext(repo, ctx, subs, extramsg)
2214 2214
2215 # run editor in the repository root 2215 # run editor in the repository root
2216 olddir = os.getcwd() 2216 olddir = os.getcwd()
2217 os.chdir(repo.root) 2217 os.chdir(repo.root)
2218 text = repo.ui.edit(committext, ctx.user(), ctx.extra()) 2218 text = repo.ui.edit(committext, ctx.user(), ctx.extra(), editform=editform)
2219 text = re.sub("(?m)^HG:.*(\n|$)", "", text) 2219 text = re.sub("(?m)^HG:.*(\n|$)", "", text)
2220 os.chdir(olddir) 2220 os.chdir(olddir)
2221 2221
2222 if finishdesc: 2222 if finishdesc:
2223 text = finishdesc(text) 2223 text = finishdesc(text)