mercurial/context.py
changeset 21238 25d6fdc0294a
parent 21203 9f12d8665c7b
child 21393 a45af4da0421
--- a/mercurial/context.py	Mon May 05 21:26:40 2014 +0900
+++ b/mercurial/context.py	Mon May 05 21:26:40 2014 +0900
@@ -208,9 +208,7 @@
     if branch:
         extra['branch'] = encoding.fromlocal(branch)
     ctx =  memctx(repo, parents, text, files, getfilectx, user,
-                          date, extra)
-    if editor:
-        ctx._text = editor(repo, ctx, [])
+                          date, extra, editor)
     return ctx
 
 class changectx(basectx):
@@ -1287,7 +1285,7 @@
     is a dictionary of metadata or is left empty.
     """
     def __init__(self, repo, parents, text, files, filectxfn, user=None,
-                 date=None, extra=None):
+                 date=None, extra=None, editor=False):
         self._repo = repo
         self._rev = None
         self._node = None
@@ -1305,6 +1303,10 @@
         if self._extra.get('branch', '') == '':
             self._extra['branch'] = 'default'
 
+        if editor:
+            self._text = editor(self._repo, self, [])
+            self._repo.savecommitmessage(self._text)
+
     def __str__(self):
         return str(self._parents[0]) + "+"