mercurial/localrepo.py
changeset 24470 76b0b0fed2e3
parent 24414 f247fbfe07f3
child 24526 cd50f3717639
--- a/mercurial/localrepo.py	Wed Mar 25 16:40:37 2015 -0700
+++ b/mercurial/localrepo.py	Wed Mar 25 13:55:32 2015 +0900
@@ -1372,10 +1372,10 @@
                         if not force:
                             raise util.Abort(
                                 _("commit with new subrepo %s excluded") % s)
-                    if wctx.sub(s).dirty(True):
+                    dirtyreason = wctx.sub(s).dirtyreason(True)
+                    if dirtyreason:
                         if not self.ui.configbool('ui', 'commitsubrepos'):
-                            raise util.Abort(
-                                _("uncommitted changes in subrepo %s") % s,
+                            raise util.Abort(dirtyreason,
                                 hint=_("use --subrepos for recursive commit"))
                         subs.append(s)
                         commitsubs.add(s)