diff -r bde1bb250fc2 -r b07d487009b2 mercurial/localrepo.py --- a/mercurial/localrepo.py Sun Feb 21 22:16:35 2010 +0100 +++ b/mercurial/localrepo.py Mon Feb 22 01:19:59 2010 +0100 @@ -787,10 +787,14 @@ # check subrepos subs = [] + removedsubs = set() + for p in wctx.parents(): + removedsubs.update(s for s in p.substate if match(s)) for s in wctx.substate: + removedsubs.discard(s) if match(s) and wctx.sub(s).dirty(): subs.append(s) - if subs and '.hgsubstate' not in changes[0]: + if (subs or removedsubs) and '.hgsubstate' not in changes[0]: changes[0].insert(0, '.hgsubstate') # make sure all explicit patterns are matched @@ -830,7 +834,7 @@ edited = (text != cctx._text) # commit subs - if subs: + if subs or removedsubs: state = wctx.substate.copy() for s in subs: self.ui.status(_('committing subrepository %s\n') % s)