Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 42101:f4b1f5537d4c
overlayworkingctx: fix file/dir audit to be repo-relative
Before this patch, test-rebase-inmemory.t would stop erroring out
about the conflict if you added a "cd a" before line 252. That was
because a glob matcher (which are relative) was unintentionally
used. That happened because the matcher was given "include" patterns
(not regular patterns), and "include" patterns are always glob by
default (i.e. unless you write them including the kind prefix). IOW,
the "default='path'" argument passed to ctx.match() was ignored.
Differential Revision: https://phab.mercurial-scm.org/D6223
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 10 Apr 2019 17:31:32 -0700 |
parents | b63b8b7ca5fa |
children | 976f069e0ad6 |
comparison
equal
deleted
inserted
replaced
42100:b63b8b7ca5fa | 42101:f4b1f5537d4c |
---|---|
1952 if component in self: | 1952 if component in self: |
1953 fail(path, component) | 1953 fail(path, component) |
1954 | 1954 |
1955 # Test the other direction -- that this path from p2 isn't a directory | 1955 # Test the other direction -- that this path from p2 isn't a directory |
1956 # in p1 (test that p1 doesn't have any paths matching `path/*`). | 1956 # in p1 (test that p1 doesn't have any paths matching `path/*`). |
1957 match = self.match(include=[path + '/'], default=b'path') | 1957 match = self.match([path + '/'], default=b'path') |
1958 matches = self.p1().manifest().matches(match) | 1958 matches = self.p1().manifest().matches(match) |
1959 mfiles = matches.keys() | 1959 mfiles = matches.keys() |
1960 if len(mfiles) > 0: | 1960 if len(mfiles) > 0: |
1961 if len(mfiles) == 1 and mfiles[0] == path: | 1961 if len(mfiles) == 1 and mfiles[0] == path: |
1962 return | 1962 return |