diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
commit | ad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (patch) | |
tree | b34b0daceb7c8e7fdde4b4ec43650ab7caadb0a9 /Tools/Scripts/webkitpy/common/checkout/scm/git.py | |
parent | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (diff) | |
download | qtwebkit-ad0d549d4cc13433f77c1ac8f0ab379c83d93f28.tar.gz |
Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 (http://svn.webkit.org/repository/webkit/trunk@108790)
Diffstat (limited to 'Tools/Scripts/webkitpy/common/checkout/scm/git.py')
-rw-r--r-- | Tools/Scripts/webkitpy/common/checkout/scm/git.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/git.py b/Tools/Scripts/webkitpy/common/checkout/scm/git.py index ab96b8fa7..7c5d80cc3 100644 --- a/Tools/Scripts/webkitpy/common/checkout/scm/git.py +++ b/Tools/Scripts/webkitpy/common/checkout/scm/git.py @@ -105,19 +105,18 @@ class Git(SCM, SVNRepository): # The Windows bots seem to through a WindowsError when git isn't installed. return False - @classmethod - def find_checkout_root(cls, path): - # FIXME: This should use a FileSystem object instead of os.path. + def find_checkout_root(self, path): # "git rev-parse --show-cdup" would be another way to get to the root - (checkout_root, dot_git) = os.path.split(run_command(['git', 'rev-parse', '--git-dir'], cwd=(path or "./"))) - if not os.path.isabs(checkout_root): # Sometimes git returns relative paths - checkout_root = os.path.join(path, checkout_root) + git_output = self._executive.run_command(['git', 'rev-parse', '--git-dir'], cwd=(path or "./")) + (checkout_root, dot_git) = self._filesystem.split(git_output) + if not self._filesystem.isabs(checkout_root): # Sometimes git returns relative paths + checkout_root = self._filesystem.join(path, checkout_root) return checkout_root - @classmethod - def to_object_name(cls, filepath): - # FIXME: This should use a FileSystem object instead of os.path. - root_end_with_slash = os.path.join(cls.find_checkout_root(os.path.dirname(filepath)), '') + def to_object_name(self, filepath): + # FIXME: This can't be the right way to append a slash. + root_end_with_slash = self._filesystem.join(self.find_checkout_root(self._filesystem.dirname(filepath)), '') + # FIXME: This seems to want some sort of rel_path instead? return filepath.replace(root_end_with_slash, '') @classmethod |