diff -r 2174f54aab18 -r 31a72e5e9200 mercurial/streamclone.py --- a/mercurial/streamclone.py Mon Aug 02 08:05:13 2021 -0400 +++ b/mercurial/streamclone.py Wed Aug 25 15:15:19 2021 +0200 @@ -821,9 +821,11 @@ dst_vfs = dst_vfs_map[k] src_path = src_vfs.join(path) dst_path = dst_vfs.join(path) - dirname = dst_vfs.dirname(path) - if not dst_vfs.exists(dirname): - dst_vfs.makedirs(dirname) + # We cannot use dirname and makedirs of dst_vfs here because the store + # encoding confuses them. See issue 6581 for details. + dirname = os.path.dirname(dst_path) + if not os.path.exists(dirname): + util.makedirs(dirname) dst_vfs.register_file(path) # XXX we could use the #nb_bytes argument. util.copyfile(