OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """This module contains the SourceControl class and related functions.""" | 5 """This module contains the SourceControl class and related functions.""" |
6 | 6 |
7 import os | 7 import os |
8 | 8 |
9 from . import bisect_utils | 9 import bisect_utils |
10 | 10 |
11 CROS_VERSION_PATTERN = 'new version number from %s' | 11 CROS_VERSION_PATTERN = 'new version number from %s' |
12 | 12 |
13 | 13 |
14 def DetermineAndCreateSourceControl(opts): | 14 def DetermineAndCreateSourceControl(opts): |
15 """Attempts to determine the underlying source control workflow and returns | 15 """Attempts to determine the underlying source control workflow and returns |
16 a SourceControl object. | 16 a SourceControl object. |
17 | 17 |
18 Returns: | 18 Returns: |
19 An instance of a SourceControl object, or None if the current workflow | 19 An instance of a SourceControl object, or None if the current workflow |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 revision_end: End of revision range. | 285 revision_end: End of revision range. |
286 | 286 |
287 Returns: | 287 Returns: |
288 Returns a list of commits that touched this file. | 288 Returns a list of commits that touched this file. |
289 """ | 289 """ |
290 cmd = ['log', '--format=%H', '%s~1..%s' % (revision_start, revision_end), | 290 cmd = ['log', '--format=%H', '%s~1..%s' % (revision_start, revision_end), |
291 '--', filename] | 291 '--', filename] |
292 output = bisect_utils.CheckRunGit(cmd) | 292 output = bisect_utils.CheckRunGit(cmd) |
293 | 293 |
294 return [o for o in output.split('\n') if o] | 294 return [o for o in output.split('\n') if o] |
OLD | NEW |