Mercurial > hg
comparison mercurial/scmutil.py @ 23582:7559dc8c4238
vfs: add a 'split' method
This method has the same behavior as the 'os.path.split' function, but having
it in vfs will allow handling of tricky encoding situations in the future.
In the same patch, we replace the use of 'os.path.split' in the transaction code.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 15 Dec 2014 13:32:34 -0800 |
parents | aed981c7bebf |
children | 164915e8ef7b |
comparison
equal
deleted
inserted
replaced
23581:aed981c7bebf | 23582:7559dc8c4238 |
---|---|
265 """join various elements of a path together (as os.path.join would do) | 265 """join various elements of a path together (as os.path.join would do) |
266 | 266 |
267 The vfs base is not injected so that path stay relative. This exists | 267 The vfs base is not injected so that path stay relative. This exists |
268 to allow handling of strange encoding if needed.""" | 268 to allow handling of strange encoding if needed.""" |
269 return os.path.join(*paths) | 269 return os.path.join(*paths) |
270 | |
271 def split(self, path): | |
272 """split top-most element of a path (as os.path.split would do) | |
273 | |
274 This exists to allow handling of strange encoding if needed.""" | |
275 return os.path.split(path) | |
270 | 276 |
271 def lexists(self, path=None): | 277 def lexists(self, path=None): |
272 return os.path.lexists(self.join(path)) | 278 return os.path.lexists(self.join(path)) |
273 | 279 |
274 def lstat(self, path=None): | 280 def lstat(self, path=None): |