comparison mercurial/cmdutil.py @ 8994:4a1187d3cb00

commit: report modified subrepos in commit editor
author Matt Mackall <mpm@selenic.com>
date Wed, 01 Jul 2009 01:05:24 -0500
parents 627399330c7d
children 78e54b9f3a62
comparison
equal deleted inserted replaced
8993:46441934c585 8994:4a1187d3cb00
1207 if opts.get('addremove'): 1207 if opts.get('addremove'):
1208 addremove(repo, pats, opts) 1208 addremove(repo, pats, opts)
1209 1209
1210 return commitfunc(ui, repo, message, match(repo, pats, opts), opts) 1210 return commitfunc(ui, repo, message, match(repo, pats, opts), opts)
1211 1211
1212 def commiteditor(repo, ctx): 1212 def commiteditor(repo, ctx, subs):
1213 if ctx.description(): 1213 if ctx.description():
1214 return ctx.description() 1214 return ctx.description()
1215 return commitforceeditor(repo, ctx) 1215 return commitforceeditor(repo, ctx, subs)
1216 1216
1217 def commitforceeditor(repo, ctx): 1217 def commitforceeditor(repo, ctx, subs):
1218 edittext = [] 1218 edittext = []
1219 modified, added, removed = ctx.modified(), ctx.added(), ctx.removed() 1219 modified, added, removed = ctx.modified(), ctx.added(), ctx.removed()
1220 if ctx.description(): 1220 if ctx.description():
1221 edittext.append(ctx.description()) 1221 edittext.append(ctx.description())
1222 edittext.append("") 1222 edittext.append("")
1229 if ctx.p2(): 1229 if ctx.p2():
1230 edittext.append(_("HG: branch merge")) 1230 edittext.append(_("HG: branch merge"))
1231 if ctx.branch(): 1231 if ctx.branch():
1232 edittext.append(_("HG: branch '%s'") 1232 edittext.append(_("HG: branch '%s'")
1233 % encoding.tolocal(ctx.branch())) 1233 % encoding.tolocal(ctx.branch()))
1234 edittext.extend([_("HG: subrepo %s") % s for s in subs])
1234 edittext.extend([_("HG: added %s") % f for f in added]) 1235 edittext.extend([_("HG: added %s") % f for f in added])
1235 edittext.extend([_("HG: changed %s") % f for f in modified]) 1236 edittext.extend([_("HG: changed %s") % f for f in modified])
1236 edittext.extend([_("HG: removed %s") % f for f in removed]) 1237 edittext.extend([_("HG: removed %s") % f for f in removed])
1237 if not added and not modified and not removed: 1238 if not added and not modified and not removed:
1238 edittext.append(_("HG: no files changed")) 1239 edittext.append(_("HG: no files changed"))