D4300: context: make sure file is not deleted while checking path conflicts

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Thu Aug 16 12:48:35 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG873f3a56993f: context: make sure file is not deleted while checking path conflicts (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4300?vs=10390&id=10394

REVISION DETAIL
  https://phab.mercurial-scm.org/D4300

AFFECTED FILES
  mercurial/context.py
  tests/test-rebase-inmemory.t

CHANGE DETAILS

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -177,8 +177,7 @@
   
   $ hg rebase -r . -d 2
   rebasing 4:daf7dfc139cb "a/a" (tip)
-  abort: error: 'a/a' conflicts with file 'a' in 2.
-  [255]
+  saved backup bundle to $TESTTMP/repo1/repo2/.hg/strip-backup/daf7dfc139cb-fdbfcf4f-rebase.hg
 
   $ cd ..
 
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -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



To: pulkit, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list