Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 39169:873f3a56993f
context: make sure file is not deleted while checking path conflicts
If a file is deleted and a directory of same name is created in the same commit,
IMM thinks of that as a file conflict, however the file is deleted and hence the
directory can be created.
The test change demonstrate the fix.
Differential Revision: https://phab.mercurial-scm.org/D4300
author | Pulkit Goyal <pulkit@yandex-team.ru> |
---|---|
date | Thu, 16 Aug 2018 16:59:40 +0300 |
parents | 95bd19f60957 |
children | d859b48730b8 |
comparison
equal
deleted
inserted
replaced
39168:02e80e37fbbc | 39169:873f3a56993f |
---|---|
1894 # Test that each new directory to be created to write this path from p2 | 1894 # Test that each new directory to be created to write this path from p2 |
1895 # is not a file in p1. | 1895 # is not a file in p1. |
1896 components = path.split('/') | 1896 components = path.split('/') |
1897 for i in pycompat.xrange(len(components)): | 1897 for i in pycompat.xrange(len(components)): |
1898 component = "/".join(components[0:i]) | 1898 component = "/".join(components[0:i]) |
1899 if component in self.p1(): | 1899 if component in self.p1() and self._cache[component]['exists']: |
1900 fail(path, component) | 1900 fail(path, component) |
1901 | 1901 |
1902 # Test the other direction -- that this path from p2 isn't a directory | 1902 # Test the other direction -- that this path from p2 isn't a directory |
1903 # in p1 (test that p1 doesn't any paths matching `path/*`). | 1903 # in p1 (test that p1 doesn't any paths matching `path/*`). |
1904 match = matchmod.match('/', '', [path + '/'], default=b'relpath') | 1904 match = matchmod.match('/', '', [path + '/'], default=b'relpath') |