Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: tools/auto_bisect/source_control.py

Issue 1001033004: Fix style in tools/auto_bisect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/auto_bisect/request_build.py ('k') | tools/auto_bisect/source_control_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 functions for performing source control operations.""" 5 """This module contains functions for performing source control operations."""
6 6
7 import bisect_utils 7 import bisect_utils
8 8
9 9
10 def IsInGitRepository(): 10 def IsInGitRepository():
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 This function executes "git footer --position-num <git hash>" command to get 130 This function executes "git footer --position-num <git hash>" command to get
131 commit position the given revision. 131 commit position the given revision.
132 132
133 Args: 133 Args:
134 git_revision: The git SHA1 to use. 134 git_revision: The git SHA1 to use.
135 cwd: Working directory to run the command from. 135 cwd: Working directory to run the command from.
136 136
137 Returns: 137 Returns:
138 Git commit position as integer or None. 138 Git commit position as integer or None.
139 """ 139 """
140 # Some of the respositories are pure git based, unlike other repositories 140 # Some of the repositories are pure git based, unlike other repositories
141 # they doesn't have commit position. e.g., skia, angle. 141 # they doesn't have commit position. e.g., skia, angle.
142 cmd = ['footers', '--position-num', git_revision] 142 cmd = ['footers', '--position-num', git_revision]
143 output, return_code = bisect_utils.RunGit(cmd, cwd) 143 output, return_code = bisect_utils.RunGit(cmd, cwd)
144 if not return_code: 144 if not return_code:
145 commit_position = output.strip() 145 commit_position = output.strip()
146 if bisect_utils.IsStringInt(commit_position): 146 if bisect_utils.IsStringInt(commit_position):
147 return int(commit_position) 147 return int(commit_position)
148 return None 148 return None
149 149
150 150
151 def GetCommitTime(git_revision, cwd=None): 151 def GetCommitTime(git_revision, cwd=None):
152 """Returns commit time for the given revision in UNIX timestamp.""" 152 """Returns commit time for the given revision in UNIX timestamp."""
153 cmd = ['log', '--format=%ct', '-1', git_revision] 153 cmd = ['log', '--format=%ct', '-1', git_revision]
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 cmd = [ 223 cmd = [
224 'log', 224 'log',
225 '--format=%H', 225 '--format=%H',
226 '%s~1..%s' % (revision_start, revision_end), 226 '%s~1..%s' % (revision_start, revision_end),
227 '--', 227 '--',
228 filename, 228 filename,
229 ] 229 ]
230 output = bisect_utils.CheckRunGit(cmd) 230 output = bisect_utils.CheckRunGit(cmd)
231 lines = output.split('\n') 231 lines = output.split('\n')
232 return [o for o in lines if o] 232 return [o for o in lines if o]
233
OLDNEW
« no previous file with comments | « tools/auto_bisect/request_build.py ('k') | tools/auto_bisect/source_control_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698