--- a/mercurial/cmdutil.py Sat Oct 17 01:15:34 2015 +0900
+++ b/mercurial/cmdutil.py Sat Oct 17 01:15:34 2015 +0900
@@ -2715,9 +2715,14 @@
# run editor in the repository root
olddir = os.getcwd()
os.chdir(repo.root)
+
+ # make in-memory changes visible to external process
+ tr = repo.currenttransaction()
+ repo.dirstate.write(tr)
+ pending = tr and tr.writepending() and repo.root
+
editortext = repo.ui.edit(committext, ctx.user(), ctx.extra(),
- editform=editform)
-
+ editform=editform, pending=pending)
text = re.sub("(?m)^HG:.*(\n|$)", "", editortext)
os.chdir(olddir)