Changeset 107145 in webkit
- Timestamp:
- Feb 8, 2012 3:59:04 PM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r107144 r107145 1 2012-02-08 Adam Barth <abarth@webkit.org> 2 3 Remove the ospath compat shim from webkitpy 4 https://bugs.webkit.org/show_bug.cgi?id=78170 5 6 Reviewed by Eric Seidel. 7 8 We no longer need this compat shim now that we don't support Python 2.5. 9 10 * Scripts/webkitpy/common/checkout/scm/git.py: 11 * Scripts/webkitpy/common/checkout/scm/svn.py: 12 * Scripts/webkitpy/common/system/filesystem.py: 13 (FileSystem.relpath): 14 * Scripts/webkitpy/common/system/filesystem_mock.py: 15 (MockFileSystem.relpath): 16 * Scripts/webkitpy/common/system/ospath.py: Removed. 17 * Scripts/webkitpy/common/system/ospath_unittest.py: Removed. 18 1 19 2012-02-08 Ryosuke Niwa <rniwa@webkit.org> 2 20 -
trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py
r106687 r107145 35 35 from webkitpy.common.system.deprecated_logging import log 36 36 from webkitpy.common.system.executive import Executive, ScriptError 37 from webkitpy.common.system import ospath38 37 39 38 from .commitmessage import CommitMessage -
trunk/Tools/Scripts/webkitpy/common/checkout/scm/svn.py
r106687 r107145 37 37 from webkitpy.common.system.deprecated_logging import log 38 38 from webkitpy.common.system.executive import Executive, ScriptError 39 from webkitpy.common.system import ospath40 39 41 40 from .scm import AuthenticationError, SCM, commit_error_handler -
trunk/Tools/Scripts/webkitpy/common/system/filesystem.py
r107136 r107145 40 40 import time 41 41 42 from webkitpy.common.system import ospath43 44 42 class FileSystem(object): 45 43 """FileSystem interface for webkitpy. … … 228 226 229 227 def relpath(self, path, start='.'): 230 return os path.relpath(path, start)228 return os.path.relpath(path, start) 231 229 232 230 class _WindowsError(exceptions.OSError): -
trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
r106692 r107145 34 34 35 35 from webkitpy.common.system import path 36 from webkitpy.common.system import ospath37 36 38 37 … … 304 303 305 304 def relpath(self, path, start='.'): 306 return ospath.relpath(path, start, self.abspath, self.sep) 305 # Since os.path.relpath() calls os.path.normpath() 306 # (see http://docs.python.org/library/os.path.html#os.path.abspath ) 307 # it also removes trailing slashes and converts forward and backward 308 # slashes to the preferred slash os.sep. 309 start = self.abspath(start) 310 path = self.abspath(path) 311 312 if not path.lower().startswith(start.lower()): 313 # Then path is outside the directory given by start. 314 return None # FIXME: os.relpath still returns a path here. 315 316 rel_path = path[len(start):] 317 318 if not rel_path: 319 # Then the paths are the same. 320 pass 321 elif rel_path[0] == self.sep: 322 # It is probably sufficient to remove just the first character 323 # since os.path.normpath() collapses separators, but we use 324 # lstrip() just to be sure. 325 rel_path = rel_path.lstrip(self.sep) 326 else: 327 # We are in the case typified by the following example: 328 # path = "/tmp/foobar", start = "/tmp/foo" -> rel_path = "bar" 329 return None 330 331 return rel_path 307 332 308 333 def remove(self, path):
Note: See TracChangeset
for help on using the changeset viewer.