commit: editor reads file lists from provided context
authorMatt Mackall <mpm@selenic.com>
Mon, 01 Jun 2009 14:51:47 -0500
changeset 8707 0550dfe4fca1
parent 8706 25e9c71b89de
child 8708 a645904c88c4
commit: editor reads file lists from provided context
mercurial/cmdutil.py
mercurial/localrepo.py
--- a/mercurial/cmdutil.py	Mon Jun 01 14:11:32 2009 -0500
+++ b/mercurial/cmdutil.py	Mon Jun 01 14:51:47 2009 -0500
@@ -1231,13 +1231,14 @@
     except ValueError, inst:
         raise util.Abort(str(inst))
 
-def commiteditor(repo, ctx, added, updated, removed):
+def commiteditor(repo, ctx):
     if ctx.description():
         return ctx.description()
-    return commitforceeditor(repo, ctx, added, updated, removed)
+    return commitforceeditor(repo, ctx)
 
-def commitforceeditor(repo, ctx, added, updated, removed):
+def commitforceeditor(repo, ctx):
     edittext = []
+    modified, added, removed = ctx.modified(), ctx.added(), ctx.removed()
     if ctx.description():
         edittext.append(ctx.description())
     edittext.append("")
@@ -1253,9 +1254,9 @@
         edittext.append(_("HG: branch '%s'")
                         % encoding.tolocal(ctx.branch()))
     edittext.extend([_("HG: added %s") % f for f in added])
-    edittext.extend([_("HG: changed %s") % f for f in updated])
+    edittext.extend([_("HG: changed %s") % f for f in modified])
     edittext.extend([_("HG: removed %s") % f for f in removed])
-    if not added and not updated and not removed:
+    if not added and not modified and not removed:
         edittext.append(_("HG: no files changed"))
     edittext.append("")
     # run editor in the repository root
--- a/mercurial/localrepo.py	Mon Jun 01 14:11:32 2009 -0500
+++ b/mercurial/localrepo.py	Mon Jun 01 14:51:47 2009 -0500
@@ -809,8 +809,7 @@
             wctx = context.workingctx(self, (p1, p2), text, user, date,
                                       extra, changes)
             if editor:
-                wctx._text = editor(self, wctx,
-                                    changes[1], changes[0], changes[2])
+                wctx._text = editor(self, wctx)
             ret = self.commitctx(wctx, True)
 
             # update dirstate and mergestate