Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
24470:76b0b0fed2e3 | 24471:1ff35d76421c |
---|---|
280 modified, added, removed, deleted = repo.status()[:4] | 280 modified, added, removed, deleted = repo.status()[:4] |
281 if modified or added or removed or deleted: | 281 if modified or added or removed or deleted: |
282 raise util.Abort(_('uncommitted changes')) | 282 raise util.Abort(_('uncommitted changes')) |
283 ctx = repo[None] | 283 ctx = repo[None] |
284 for s in sorted(ctx.substate): | 284 for s in sorted(ctx.substate): |
285 if ctx.sub(s).dirty(): | 285 ctx.sub(s).bailifchanged() |
286 raise util.Abort(_("uncommitted changes in subrepo %s") % s) | |
287 | 286 |
288 def logmessage(ui, opts): | 287 def logmessage(ui, opts): |
289 """ get the log message according to -m and -l option """ | 288 """ get the log message according to -m and -l option """ |
290 message = opts.get('message') | 289 message = opts.get('message') |
291 logfile = opts.get('logfile') | 290 logfile = opts.get('logfile') |