Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.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 | 6becb9dbca25 |
children | a8e6897dffbe |
comparison
equal
deleted
inserted
replaced
24470:76b0b0fed2e3 | 24471:1ff35d76421c |
---|---|
1043 "or check 'hg heads'")) | 1043 "or check 'hg heads'")) |
1044 if not force and (wc.files() or wc.deleted()): | 1044 if not force and (wc.files() or wc.deleted()): |
1045 raise util.Abort(_("uncommitted changes"), | 1045 raise util.Abort(_("uncommitted changes"), |
1046 hint=_("use 'hg status' to list changes")) | 1046 hint=_("use 'hg status' to list changes")) |
1047 for s in sorted(wc.substate): | 1047 for s in sorted(wc.substate): |
1048 if wc.sub(s).dirty(): | 1048 wc.sub(s).bailifchanged() |
1049 raise util.Abort(_("uncommitted changes in " | |
1050 "subrepository '%s'") % s) | |
1051 | 1049 |
1052 elif not overwrite: | 1050 elif not overwrite: |
1053 if p1 == p2: # no-op update | 1051 if p1 == p2: # no-op update |
1054 # call the hooks and exit early | 1052 # call the hooks and exit early |
1055 repo.hook('preupdate', throw=True, parent1=xp2, parent2='') | 1053 repo.hook('preupdate', throw=True, parent1=xp2, parent2='') |