diff mercurial/upgrade.py @ 43001:bb6902cbbe23

upgrade: create the correct destination directory for copies revlogs The encoding in vfs mess up with the directory we are trying to create manually. We could duplicate the advanced logic some more, but that seems ill fated. Instead, we let the vfs deal with directory creation. We update the test to contains a name affected by encoding. Differential Revision: https://phab.mercurial-scm.org/D6902
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 27 Sep 2019 21:14:03 +0200
parents a3c2ffcd266f
children 164bbf674bb6
line wrap: on
line diff
--- a/mercurial/upgrade.py	Fri Sep 27 13:16:37 2019 +0200
+++ b/mercurial/upgrade.py	Fri Sep 27 21:14:03 2019 +0200
@@ -557,8 +557,8 @@
     olddata = oldvfs.join(oldrl.datafile)
     newdata = newvfs.join(newrl.datafile)
 
-    newdir = newvfs.dirname(newrl.indexfile)
-    newvfs.makedirs(newdir)
+    with newvfs(newrl.indexfile, 'w'):
+        pass # create all the directories
 
     util.copyfile(oldindex, newindex)
     if oldrl.opener.exists(olddata):