##// END OF EJS Templates
commit: editor reads file lists from provided context
Matt Mackall -
r8707:0550dfe4 default
parent child Browse files
Show More
@@ -1231,13 +1231,14 b' def commit(ui, repo, commitfunc, pats, o'
1231 except ValueError, inst:
1231 except ValueError, inst:
1232 raise util.Abort(str(inst))
1232 raise util.Abort(str(inst))
1233
1233
1234 def commiteditor(repo, ctx, added, updated, removed):
1234 def commiteditor(repo, ctx):
1235 if ctx.description():
1235 if ctx.description():
1236 return ctx.description()
1236 return ctx.description()
1237 return commitforceeditor(repo, ctx, added, updated, removed)
1237 return commitforceeditor(repo, ctx)
1238
1238
1239 def commitforceeditor(repo, ctx, added, updated, removed):
1239 def commitforceeditor(repo, ctx):
1240 edittext = []
1240 edittext = []
1241 modified, added, removed = ctx.modified(), ctx.added(), ctx.removed()
1241 if ctx.description():
1242 if ctx.description():
1242 edittext.append(ctx.description())
1243 edittext.append(ctx.description())
1243 edittext.append("")
1244 edittext.append("")
@@ -1253,9 +1254,9 b' def commitforceeditor(repo, ctx, added, '
1253 edittext.append(_("HG: branch '%s'")
1254 edittext.append(_("HG: branch '%s'")
1254 % encoding.tolocal(ctx.branch()))
1255 % encoding.tolocal(ctx.branch()))
1255 edittext.extend([_("HG: added %s") % f for f in added])
1256 edittext.extend([_("HG: added %s") % f for f in added])
1256 edittext.extend([_("HG: changed %s") % f for f in updated])
1257 edittext.extend([_("HG: changed %s") % f for f in modified])
1257 edittext.extend([_("HG: removed %s") % f for f in removed])
1258 edittext.extend([_("HG: removed %s") % f for f in removed])
1258 if not added and not updated and not removed:
1259 if not added and not modified and not removed:
1259 edittext.append(_("HG: no files changed"))
1260 edittext.append(_("HG: no files changed"))
1260 edittext.append("")
1261 edittext.append("")
1261 # run editor in the repository root
1262 # run editor in the repository root
@@ -809,8 +809,7 b' class localrepository(repo.repository):'
809 wctx = context.workingctx(self, (p1, p2), text, user, date,
809 wctx = context.workingctx(self, (p1, p2), text, user, date,
810 extra, changes)
810 extra, changes)
811 if editor:
811 if editor:
812 wctx._text = editor(self, wctx,
812 wctx._text = editor(self, wctx)
813 changes[1], changes[0], changes[2])
814 ret = self.commitctx(wctx, True)
813 ret = self.commitctx(wctx, True)
815
814
816 # update dirstate and mergestate
815 # update dirstate and mergestate
General Comments 0
You need to be logged in to leave comments. Login now