Mercurial > public > mercurial-scm > hg
diff hgext/mq.py @ 13035:f08df4d38442 stable
mq: ignore subrepos (issue2499)
If MQ allows modifying .hgsub or .hgsubstate in a patch, it can easily
lead to an inconsistent subrepo state. This patch prevents qrefresh from
adding any modifications to .hgsub or .hgsubstate to a patch. The user
is warned that these files are not included in the patch.
The tests test both the slightly irrational and the pathological cases.
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Tue, 16 Nov 2010 13:06:07 -0600 |
parents | da4a9ed369c8 |
children | 77aa74fe0e0b 0a1eefaf98f2 |
line wrap: on
line diff
--- a/hgext/mq.py Mon Nov 22 16:05:31 2010 +0100 +++ b/hgext/mq.py Tue Nov 16 13:06:07 2010 -0600 @@ -1295,12 +1295,18 @@ # local dirstate. in this case, we want them to only # show up in the added section for x in m: + if x == '.hgsub' or x == '.hgsubstate': + self.ui.warn(_('warning: not refreshing %s\n') % x) + continue if x not in aa: mm.append(x) # we might end up with files added by the local dirstate that # were deleted by the patch. In this case, they should only # show up in the changed section. for x in a: + if x == '.hgsub' or x == '.hgsubstate': + self.ui.warn(_('warning: not adding %s\n') % x) + continue if x in dd: del dd[dd.index(x)] mm.append(x) @@ -1310,6 +1316,9 @@ # are not in the add or change column of the patch forget = [] for x in d + r: + if x == '.hgsub' or x == '.hgsubstate': + self.ui.warn(_('warning: not removing %s\n') % x) + continue if x in aa: del aa[aa.index(x)] forget.append(x)