| OLD | NEW |
| 1 # Copyright (c) 2010 Google Inc. All rights reserved. | 1 # Copyright (c) 2010 Google Inc. All rights reserved. |
| 2 # Copyright (c) 2009 Apple Inc. All rights reserved. | 2 # Copyright (c) 2009 Apple Inc. All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | 29 |
| 30 import logging | 30 import logging |
| 31 import os | 31 import os |
| 32 import sys | 32 import sys |
| 33 | 33 |
| 34 from webkitpy.common.checkout import Checkout | |
| 35 from webkitpy.common.checkout.scm.detection import SCMDetector | 34 from webkitpy.common.checkout.scm.detection import SCMDetector |
| 36 from webkitpy.common.memoized import memoized | 35 from webkitpy.common.memoized import memoized |
| 37 from webkitpy.common.net import buildbot, web | 36 from webkitpy.common.net import buildbot, web |
| 38 from webkitpy.common.net.buildbot.chromiumbuildbot import ChromiumBuildBot | 37 from webkitpy.common.net.buildbot.chromiumbuildbot import ChromiumBuildBot |
| 39 from webkitpy.common.system.systemhost import SystemHost | 38 from webkitpy.common.system.systemhost import SystemHost |
| 40 from webkitpy.layout_tests.port.factory import PortFactory | 39 from webkitpy.layout_tests.port.factory import PortFactory |
| 41 | 40 |
| 42 | 41 |
| 43 _log = logging.getLogger(__name__) | 42 _log = logging.getLogger(__name__) |
| 44 | 43 |
| 45 | 44 |
| 46 class Host(SystemHost): | 45 class Host(SystemHost): |
| 47 def __init__(self): | 46 def __init__(self): |
| 48 SystemHost.__init__(self) | 47 SystemHost.__init__(self) |
| 49 self.web = web.Web() | 48 self.web = web.Web() |
| 50 | 49 |
| 51 # FIXME: Checkout should own the scm object. | |
| 52 self._scm = None | 50 self._scm = None |
| 53 self._checkout = None | |
| 54 | 51 |
| 55 # Everything below this line is WebKit-specific and belongs on a higher-
level object. | 52 # Everything below this line is WebKit-specific and belongs on a higher-
level object. |
| 56 self.buildbot = buildbot.BuildBot() | 53 self.buildbot = buildbot.BuildBot() |
| 57 | 54 |
| 58 # FIXME: Unfortunately Port objects are currently the central-dispatch o
bjects of the NRWT world. | 55 # FIXME: Unfortunately Port objects are currently the central-dispatch o
bjects of the NRWT world. |
| 59 # In order to instantiate a port correctly, we have to pass it at least
an executive, user, scm, and filesystem | 56 # In order to instantiate a port correctly, we have to pass it at least
an executive, user, scm, and filesystem |
| 60 # so for now we just pass along the whole Host object. | 57 # so for now we just pass along the whole Host object. |
| 61 # FIXME: PortFactory doesn't belong on this Host object if Port is going
to have a Host (circular dependency). | 58 # FIXME: PortFactory doesn't belong on this Host object if Port is going
to have a Host (circular dependency). |
| 62 self.port_factory = PortFactory(self) | 59 self.port_factory = PortFactory(self) |
| 63 | 60 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 from webkitpy.common.checkout.scm.git import Git | 118 from webkitpy.common.checkout.scm.git import Git |
| 122 Git.executable_name = 'git.bat' | 119 Git.executable_name = 'git.bat' |
| 123 except OSError, e: | 120 except OSError, e: |
| 124 _log.debug('Failed to engage git.bat Windows hack.') | 121 _log.debug('Failed to engage git.bat Windows hack.') |
| 125 | 122 |
| 126 def initialize_scm(self, patch_directories=None): | 123 def initialize_scm(self, patch_directories=None): |
| 127 if sys.platform == "win32": | 124 if sys.platform == "win32": |
| 128 self._engage_awesome_windows_hacks() | 125 self._engage_awesome_windows_hacks() |
| 129 detector = SCMDetector(self.filesystem, self.executive) | 126 detector = SCMDetector(self.filesystem, self.executive) |
| 130 self._scm = detector.default_scm(patch_directories) | 127 self._scm = detector.default_scm(patch_directories) |
| 131 self._checkout = Checkout(self.scm()) | |
| 132 | 128 |
| 133 def scm(self): | 129 def scm(self): |
| 134 return self._scm | 130 return self._scm |
| 135 | 131 |
| 136 def checkout(self): | |
| 137 return self._checkout | |
| 138 | |
| 139 def buildbot_for_builder_name(self, name): | 132 def buildbot_for_builder_name(self, name): |
| 140 if self.port_factory.get_from_builder_name(name).is_chromium(): | 133 if self.port_factory.get_from_builder_name(name).is_chromium(): |
| 141 return self.chromium_buildbot() | 134 return self.chromium_buildbot() |
| 142 return self.buildbot | 135 return self.buildbot |
| 143 | 136 |
| 144 @memoized | 137 @memoized |
| 145 def chromium_buildbot(self): | 138 def chromium_buildbot(self): |
| 146 return ChromiumBuildBot() | 139 return ChromiumBuildBot() |
| OLD | NEW |