comparison mercurial/util.py @ 47622:bb917eea1605

windows: introduce a `util.abspath` to replace os.path.abspath This will let us mitigate the drive letter capitalization hell. See inline comment for details. Differential Revision: https://phab.mercurial-scm.org/D11059
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 10 Jul 2021 13:46:24 +0200
parents 09ff5d532a25
children ae79611e3115
comparison
equal deleted inserted replaced
47621:d6ee6456bd5f 47622:bb917eea1605
97 else: 97 else:
98 from . import posix as platform 98 from . import posix as platform
99 99
100 _ = i18n._ 100 _ = i18n._
101 101
102 abspath = platform.abspath
102 bindunixsocket = platform.bindunixsocket 103 bindunixsocket = platform.bindunixsocket
103 cachestat = platform.cachestat 104 cachestat = platform.cachestat
104 checkexec = platform.checkexec 105 checkexec = platform.checkexec
105 checklink = platform.checklink 106 checklink = platform.checklink
106 copymode = platform.copymode 107 copymode = platform.copymode
2630 except OSError as err: 2631 except OSError as err:
2631 if err.errno == errno.EEXIST: 2632 if err.errno == errno.EEXIST:
2632 return 2633 return
2633 if err.errno != errno.ENOENT or not name: 2634 if err.errno != errno.ENOENT or not name:
2634 raise 2635 raise
2635 parent = os.path.dirname(os.path.abspath(name)) 2636 parent = os.path.dirname(abspath(name))
2636 if parent == name: 2637 if parent == name:
2637 raise 2638 raise
2638 makedirs(parent, mode, notindexed) 2639 makedirs(parent, mode, notindexed)
2639 try: 2640 try:
2640 makedir(name, notindexed) 2641 makedir(name, notindexed)