[Updated] D11340: clone: properly create target directories during local clone (issue6581)

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Wed Aug 25 13:07:25 UTC 2021


Closed by commit rHGad31e755a7c6: clone: properly create target directories during local clone (issue6581) (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D11340?vs=30016&id=30021#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11340?vs=30016&id=30021

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11340/new/

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

AFFECTED FILES
  mercurial/streamclone.py
  tests/test-clone-stream.t

CHANGE DETAILS

diff --git a/tests/test-clone-stream.t b/tests/test-clone-stream.t
--- a/tests/test-clone-stream.t
+++ b/tests/test-clone-stream.t
@@ -177,21 +177,17 @@
 This is present here to reuse the testing around file with "special" names.
 
   $ hg clone server local-clone
-  updating to branch default (missing-correct-output !)
-  1088 files updated, 0 files merged, 0 files removed, 0 files unresolved (missing-correct-output !)
-  abort: $ENOENT$: '$TESTTMP/local-clone/.hg/store/dh/containe/isam-bui/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4d94041277bcd011e1d54c247523c124b4a325686.i' (known-bad-output !)
-  [255]
+  updating to branch default
+  1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Check that the clone went well
 
   $ hg verify -R local-clone
-  checking changesets (missing-correct-output !)
-  checking manifests (missing-correct-output !)
-  crosschecking files in changesets and manifests (missing-correct-output !)
-  checking files (missing-correct-output !)
-  checked 3 changesets with 1088 changes to 1088 files (missing-correct-output !)
-  abort: repository local-clone not found (known-bad-output !)
-  [255]
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  checked 3 changesets with 1088 changes to 1088 files
 
 Check uncompressed
 ==================
diff --git a/mercurial/streamclone.py b/mercurial/streamclone.py
--- a/mercurial/streamclone.py
+++ b/mercurial/streamclone.py
@@ -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(



To: marmoute, #hg-reviewers, Alphare
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210825/e698d32c/attachment-0002.html>


More information about the Mercurial-patches mailing list