Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 10522:b07d487009b2 stable
subrepo: Update .hgsubstate in case of deleted subrepo
When a subrepo is deleted from .hgsub, it also needs to be removed from
.hgsubstate. Previous code was updating .hgsubstate only in case of newly or
modified subrepo.
author | Saint Germain <saintger@gmail.com> |
---|---|
date | Mon, 22 Feb 2010 01:19:59 +0100 |
parents | f75db9927429 |
children | bae9bb09166b |
line wrap: on
line diff
--- 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)