comparison mercurial/upgrade.py @ 42999: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
comparison
equal deleted inserted replaced
42998:8a31294fa25c 42999:bb6902cbbe23
555 oldindex = oldvfs.join(oldrl.indexfile) 555 oldindex = oldvfs.join(oldrl.indexfile)
556 newindex = newvfs.join(newrl.indexfile) 556 newindex = newvfs.join(newrl.indexfile)
557 olddata = oldvfs.join(oldrl.datafile) 557 olddata = oldvfs.join(oldrl.datafile)
558 newdata = newvfs.join(newrl.datafile) 558 newdata = newvfs.join(newrl.datafile)
559 559
560 newdir = newvfs.dirname(newrl.indexfile) 560 with newvfs(newrl.indexfile, 'w'):
561 newvfs.makedirs(newdir) 561 pass # create all the directories
562 562
563 util.copyfile(oldindex, newindex) 563 util.copyfile(oldindex, newindex)
564 if oldrl.opener.exists(olddata): 564 if oldrl.opener.exists(olddata):
565 util.copyfile(olddata, newdata) 565 util.copyfile(olddata, newdata)
566 566