branching: merge with stable
authorRaphaël Gomès <rgomes@octobus.net>
Tue, 18 Jan 2022 10:27:13 +0100
changeset 48569 f13fb742e1d8
parent 48567 d1210d56008b (current diff)
parent 48568 440972d2175d (diff)
child 48572 fe4922564661
branching: merge with stable
mercurial/hg.py
rust/hg-core/src/dirstate_tree/on_disk.rs
--- 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 []