Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from slave import recipe_api | 5 from slave import recipe_api |
| 6 | 6 |
| 7 def jsonish_to_python(spec, is_top=False): | 7 def jsonish_to_python(spec, is_top=False): |
| 8 ret = '' | 8 ret = '' |
| 9 if is_top: # We're the 'top' level, so treat this dict as a suite. | 9 if is_top: # We're the 'top' level, so treat this dict as a suite. |
| 10 ret = '\n'.join( | 10 ret = '\n'.join( |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 | 139 |
| 140 cfg_cmds = [ | 140 cfg_cmds = [ |
| 141 ('user.name', 'local_bot'), | 141 ('user.name', 'local_bot'), |
| 142 ('user.email', 'local_bot@example.com'), | 142 ('user.email', 'local_bot@example.com'), |
| 143 ] | 143 ] |
| 144 for var, val in cfg_cmds: | 144 for var, val in cfg_cmds: |
| 145 name = 'recurse (git config %s)' % var | 145 name = 'recurse (git config %s)' % var |
| 146 steps.append(self(name, ['recurse', 'git', 'config', var, val], | 146 steps.append(self(name, ['recurse', 'git', 'config', var, val], |
| 147 **kwargs)) | 147 **kwargs)) |
| 148 | 148 |
| 149 cwd = kwargs.get('cwd') | 149 cwd = kwargs.get('cwd', self.m.path.slave_build) |
| 150 for c in cfg.checkouts: | 150 self.m.path.set_dynamic_path( |
| 151 path = self.m.path.slave_build(c) | 151 'checkout', cwd(*cfg.solutions[0].name.split(self.m.path.sep)), |
|
agable
2013/09/26 21:46:02
So we've lost the ability to save multiple paths i
iannucci
2013/09/27 02:08:20
I converted the users of this feature over. It was
| |
| 152 if cwd: | 152 default=True) |
| 153 path = self.m.path.join(cwd, c) | |
| 154 self.m.path.add_checkout(path) | |
| 155 for s in cfg.solutions: | |
| 156 path = self.m.path.slave_build(s.name) | |
| 157 if cwd: | |
| 158 path = self.m.path.join(cwd, s.name) | |
| 159 self.m.path.add_checkout(path) | |
| 160 | 153 |
| 161 return steps | 154 return steps |
| 162 | 155 |
| 163 def revert(self, **kwargs): | 156 def revert(self, **kwargs): |
| 164 """Return a gclient_safe_revert step.""" | 157 """Return a gclient_safe_revert step.""" |
| 165 # Not directly calling gclient, so don't use self(). | 158 # Not directly calling gclient, so don't use self(). |
| 166 prefix = 'gclient ' | 159 prefix = 'gclient ' |
| 167 if self.spec_alias: | 160 if self.spec_alias: |
| 168 prefix = ('[spec: %s] ' % self.spec_alias) + prefix | 161 prefix = ('[spec: %s] ' % self.spec_alias) + prefix |
| 169 | 162 |
| 170 return self.m.python(prefix + 'revert', | 163 return self.m.python(prefix + 'revert', |
| 171 self.m.path.build('scripts', 'slave', 'gclient_safe_revert.py'), | 164 self.m.path.build('scripts', 'slave', 'gclient_safe_revert.py'), |
| 172 ['.', self.m.path.depot_tools('gclient', wrapper=True)], | 165 ['.', self.m.path.depot_tools('gclient', wrapper=True)], |
| 173 **kwargs | 166 **kwargs |
| 174 ) | 167 ) |
| 175 | 168 |
| 176 def runhooks(self, args=None, **kwargs): | 169 def runhooks(self, args=None, **kwargs): |
| 177 """Return a 'gclient runhooks' step.""" | 170 """Return a 'gclient runhooks' step.""" |
| 178 args = args or [] | 171 args = args or [] |
| 179 assert isinstance(args, (list, tuple)) | 172 assert isinstance(args, (list, tuple)) |
| 180 return self('runhooks', ['runhooks'] + list(args), **kwargs) | 173 return self('runhooks', ['runhooks'] + list(args), **kwargs) |
| OLD | NEW |