changeset 48596:f13fb742e1d8

branching: merge with stable
author Raphaël Gomès <rgomes@octobus.net>
date Tue, 18 Jan 2022 10:27:13 +0100
parents d1210d56008b (current diff) 440972d2175d (diff)
children fe4922564661
files mercurial/hg.py rust/hg-core/src/dirstate_tree/on_disk.rs
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Mon Jan 17 12:50:13 2022 +0100
+++ b/mercurial/hg.py	Tue Jan 18 10:27:13 2022 +0100
@@ -10,6 +10,7 @@
 
 import errno
 import os
+import posixpath
 import shutil
 import stat
 import weakref
@@ -1285,7 +1286,11 @@
             source = bytes(subpath)
         else:
             p = urlutil.url(source)
-            p.path = os.path.normpath(b'%s/%s' % (p.path, subpath))
+            if p.islocal():
+                normpath = os.path.normpath
+            else:
+                normpath = posixpath.normpath
+            p.path = normpath(b'%s/%s' % (p.path, subpath))
             source = bytes(p)
     other = peer(repo, opts, source)
     cleanupfn = other.close
@@ -1356,7 +1361,11 @@
                 dest = bytes(subpath)
             else:
                 p = urlutil.url(dest)
-                p.path = os.path.normpath(b'%s/%s' % (p.path, subpath))
+                if p.islocal():
+                    normpath = os.path.normpath
+                else:
+                    normpath = posixpath.normpath
+                p.path = normpath(b'%s/%s' % (p.path, subpath))
                 dest = bytes(p)
         branches = path.branch, opts.get(b'branch') or []