# HG changeset patch # User FUJIWARA Katsunori # Date 2012-04-05 14:52:06 # Node ID 5d61e007d95735615b8d01782ac3aae33c9cdd2c # Parent 2cdd7e63211bf729f63f88981823c0bd07868de7 mq: use exact matching in the second dirstate walking for efficiency of 'qnew' 'hg qnew' with pattern/-I/-X creates matching object with them, and uses it twice for 'dirstate.walk()': via 'repo.status()' and 'repo.commit()'. this may cause full manifest scan in the second 'dirstate.walk()', even though mq already knows complete target filenames at the first 'dirstate.walk()'. this patch creates exact matching object also in this case, and use it at 'repo.commit()' invocation to avoid full manifest scan in the second 'dirstate.walk()'. even though 'inclsubs' is added to 'pats' for original matching object, it is also passed to exact matching object, because subrepositories are deleted from result of 'dirstate.walk()' at the end of it. diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -962,7 +962,7 @@ class queue(object): m, a, r, d = repo.status(match=match)[:4] else: m, a, r, d = self.checklocalchanges(repo, force=True) - match = scmutil.matchfiles(repo, m + a + r + inclsubs) + match = scmutil.matchfiles(repo, m + a + r + inclsubs) if len(repo[None].parents()) > 1: raise util.Abort(_('cannot manage merge changesets')) commitfiles = m + a + r