diff mercurial/cmdutil.py @ 24471:1ff35d76421c

subrepo: add bailifchanged to centralize raising Abort if subrepo is dirty This patch also centralizes composing dirty reason message like "uncommitted changes in subrepository 'xxxx'".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 25 Mar 2015 13:55:35 +0900
parents 30ddc3cf76df
children 1bf71faf042e
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Wed Mar 25 13:55:32 2015 +0900
+++ b/mercurial/cmdutil.py	Wed Mar 25 13:55:35 2015 +0900
@@ -282,8 +282,7 @@
         raise util.Abort(_('uncommitted changes'))
     ctx = repo[None]
     for s in sorted(ctx.substate):
-        if ctx.sub(s).dirty():
-            raise util.Abort(_("uncommitted changes in subrepo %s") % s)
+        ctx.sub(s).bailifchanged()
 
 def logmessage(ui, opts):
     """ get the log message according to -m and -l option """