diff mercurial/context.py @ 39132: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
line wrap: on
line diff
--- a/mercurial/context.py	Thu Aug 16 16:53:48 2018 +0300
+++ b/mercurial/context.py	Thu Aug 16 16:59:40 2018 +0300
@@ -1896,7 +1896,7 @@
         components = path.split('/')
         for i in pycompat.xrange(len(components)):
             component = "/".join(components[0:i])
-            if component in self.p1():
+            if component in self.p1() and self._cache[component]['exists']:
                 fail(path, component)
 
         # Test the other direction -- that this path from p2 isn't a directory