mercurial/cmdutil.py
changeset 45716 9628d3cd9d13
parent 45651 c7413ffe0402
child 45720 508dfd1c18df
--- a/mercurial/cmdutil.py	Sat Oct 10 12:43:04 2020 +0530
+++ b/mercurial/cmdutil.py	Wed Oct 14 14:43:39 2020 -0700
@@ -558,7 +558,7 @@
             # backup continues
             for f in tobackup:
                 fd, tmpname = pycompat.mkstemp(
-                    prefix=f.replace(b'/', b'_') + b'.', dir=backupdir
+                    prefix=os.path.basename(f) + b'.', dir=backupdir
                 )
                 os.close(fd)
                 ui.debug(b'backup %r as %r\n' % (f, tmpname))