Mercurial > hg > mercurial-source
diff hgext/strip.py @ 24602: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 (2015-03-25) |
parents | 135b23868f45 |
children | 69154e0ae384 |
line wrap: on
line diff
--- a/hgext/strip.py +++ b/hgext/strip.py @@ -23,10 +23,8 @@ else: bctx = wctx.parents()[0] for s in sorted(wctx.substate): - if wctx.sub(s).dirty(True): - raise util.Abort( - _("uncommitted changes in subrepository %s") % s) - elif s not in bctx.substate or bctx.sub(s).dirty(): + wctx.sub(s).bailifchanged(True) + if s not in bctx.substate or bctx.sub(s).dirty(): inclsubs.append(s) return inclsubs