commit: report modified subrepos in commit editor
authorMatt Mackall <mpm@selenic.com>
Wed, 01 Jul 2009 01:05:24 -0500
changeset 8994 4a1187d3cb00
parent 8993 46441934c585
child 8995 7b19cda0fa10
commit: report modified subrepos in commit editor
mercurial/cmdutil.py
mercurial/localrepo.py
--- a/mercurial/cmdutil.py	Wed Jul 01 00:41:14 2009 -0500
+++ b/mercurial/cmdutil.py	Wed Jul 01 01:05:24 2009 -0500
@@ -1209,12 +1209,12 @@
 
     return commitfunc(ui, repo, message, match(repo, pats, opts), opts)
 
-def commiteditor(repo, ctx):
+def commiteditor(repo, ctx, subs):
     if ctx.description():
         return ctx.description()
-    return commitforceeditor(repo, ctx)
+    return commitforceeditor(repo, ctx, subs)
 
-def commitforceeditor(repo, ctx):
+def commitforceeditor(repo, ctx, subs):
     edittext = []
     modified, added, removed = ctx.modified(), ctx.added(), ctx.removed()
     if ctx.description():
@@ -1231,6 +1231,7 @@
     if ctx.branch():
         edittext.append(_("HG: branch '%s'")
                         % encoding.tolocal(ctx.branch()))
+    edittext.extend([_("HG: subrepo %s") % s for s in subs])
     edittext.extend([_("HG: added %s") % f for f in added])
     edittext.extend([_("HG: changed %s") % f for f in modified])
     edittext.extend([_("HG: removed %s") % f for f in removed])
--- a/mercurial/localrepo.py	Wed Jul 01 00:41:14 2009 -0500
+++ b/mercurial/localrepo.py	Wed Jul 01 01:05:24 2009 -0500
@@ -872,7 +872,7 @@
             cctx = context.workingctx(self, (p1, p2), text, user, date,
                                       extra, changes)
             if editor:
-                cctx._text = editor(self, cctx)
+                cctx._text = editor(self, cctx, subs)
 
             # commit subs
             if subs: