comparison mercurial/context.py @ 41775:cd7059d17cb2

context: use includematcher when checking dir/file conflicts This is for performance; patternmatcher can't easily interpret its results to make visitchildrenset be the "optimal" set of paths to inspect, but includematcher can. Since there aren't any special patterns being used here, I believe that the two matchers are equivalent. Differential Revision: https://phab.mercurial-scm.org/D5999
author Kyle Lippincott <spectral@google.com>
date Thu, 21 Feb 2019 19:11:35 -0800
parents aaad36b88298
children 041d829575ed
comparison
equal deleted inserted replaced
41774:0b2361c2c493 41775:cd7059d17cb2
1949 if component in self: 1949 if component in self:
1950 fail(path, component) 1950 fail(path, component)
1951 1951
1952 # Test the other direction -- that this path from p2 isn't a directory 1952 # Test the other direction -- that this path from p2 isn't a directory
1953 # in p1 (test that p1 doesn't have any paths matching `path/*`). 1953 # in p1 (test that p1 doesn't have any paths matching `path/*`).
1954 match = self.match(pats=[path + '/'], default=b'path') 1954 match = self.match(include=[path + '/'], default=b'path')
1955 matches = self.p1().manifest().matches(match) 1955 matches = self.p1().manifest().matches(match)
1956 mfiles = matches.keys() 1956 mfiles = matches.keys()
1957 if len(mfiles) > 0: 1957 if len(mfiles) > 0:
1958 if len(mfiles) == 1 and mfiles[0] == path: 1958 if len(mfiles) == 1 and mfiles[0] == path:
1959 return 1959 return