Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Gclient-specific SCM-specific operations.""" | 5 """Gclient-specific SCM-specific operations.""" |
| 6 | 6 |
| 7 from __future__ import print_function | 7 from __future__ import print_function |
| 8 | 8 |
| 9 import errno | 9 import errno |
| 10 import logging | 10 import logging |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 263 def GetCheckoutRoot(self): | 263 def GetCheckoutRoot(self): |
| 264 return scm.GIT.GetCheckoutRoot(self.checkout_path) | 264 return scm.GIT.GetCheckoutRoot(self.checkout_path) |
| 265 | 265 |
| 266 def GetRevisionDate(self, _revision): | 266 def GetRevisionDate(self, _revision): |
| 267 """Returns the given revision's date in ISO-8601 format (which contains the | 267 """Returns the given revision's date in ISO-8601 format (which contains the |
| 268 time zone).""" | 268 time zone).""" |
| 269 # TODO(floitsch): get the time-stamp of the given revision and not just the | 269 # TODO(floitsch): get the time-stamp of the given revision and not just the |
| 270 # time-stamp of the currently checked out revision. | 270 # time-stamp of the currently checked out revision. |
| 271 return self._Capture(['log', '-n', '1', '--format=%ai']) | 271 return self._Capture(['log', '-n', '1', '--format=%ai']) |
| 272 | 272 |
| 273 @staticmethod | 273 def cleanup(self, options, args, file_list): |
| 274 def cleanup(options, args, file_list): | 274 """'Cleanup' the repo.""" |
| 275 """'Cleanup' the repo. | 275 self._maybe_break_locks(options) |
|
agable
2016/10/28 16:55:34
I think you can set the flag directly on the optio
katthomas
2016/10/28 23:40:29
Done.
| |
| 276 | 276 |
| 277 There's no real git equivalent for the svn cleanup command, do a no-op. | |
| 278 """ | |
| 279 | 277 |
| 280 def diff(self, options, _args, _file_list): | 278 def diff(self, options, _args, _file_list): |
| 281 try: | 279 try: |
| 282 merge_base = [self._Capture(['merge-base', 'HEAD', self.remote])] | 280 merge_base = [self._Capture(['merge-base', 'HEAD', self.remote])] |
| 283 except subprocess2.CalledProcessError: | 281 except subprocess2.CalledProcessError: |
| 284 merge_base = [] | 282 merge_base = [] |
| 285 self._Run(['diff'] + merge_base, options) | 283 self._Run(['diff'] + merge_base, options) |
| 286 | 284 |
| 287 def pack(self, _options, _args, _file_list): | 285 def pack(self, _options, _args, _file_list): |
| 288 """Generates a patch file which can be applied to the root of the | 286 """Generates a patch file which can be applied to the root of the |
| (...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1175 kwargs.setdefault('cwd', self.checkout_path) | 1173 kwargs.setdefault('cwd', self.checkout_path) |
| 1176 kwargs.setdefault('stdout', self.out_fh) | 1174 kwargs.setdefault('stdout', self.out_fh) |
| 1177 kwargs['filter_fn'] = self.filter | 1175 kwargs['filter_fn'] = self.filter |
| 1178 kwargs.setdefault('print_stdout', False) | 1176 kwargs.setdefault('print_stdout', False) |
| 1179 env = scm.GIT.ApplyEnvVars(kwargs) | 1177 env = scm.GIT.ApplyEnvVars(kwargs) |
| 1180 cmd = ['git'] + args | 1178 cmd = ['git'] + args |
| 1181 if show_header: | 1179 if show_header: |
| 1182 gclient_utils.CheckCallAndFilterAndHeader(cmd, env=env, **kwargs) | 1180 gclient_utils.CheckCallAndFilterAndHeader(cmd, env=env, **kwargs) |
| 1183 else: | 1181 else: |
| 1184 gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs) | 1182 gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs) |
| OLD | NEW |