# HG changeset patch # User Matt Mackall # Date 1243885907 18000 # Node ID 0550dfe4fca1114ca21b2a83c1431ac9cc330e1c # Parent 25e9c71b89de423585856ef687927b95e990018f commit: editor reads file lists from provided context diff -r 25e9c71b89de -r 0550dfe4fca1 mercurial/cmdutil.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 diff -r 25e9c71b89de -r 0550dfe4fca1 mercurial/localrepo.py --- 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