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 import re | 8 import re |
9 | 9 |
10 from . import bisect_utils | 10 from . import bisect_utils |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 { | 255 { |
256 'author': %s, | 256 'author': %s, |
257 'email': %s, | 257 'email': %s, |
258 'date': %s, | 258 'date': %s, |
259 'subject': %s, | 259 'subject': %s, |
260 'body': %s, | 260 'body': %s, |
261 } | 261 } |
262 """ | 262 """ |
263 commit_info = {} | 263 commit_info = {} |
264 | 264 |
265 formats = ['%cN', '%cE', '%s', '%cD', '%b'] | 265 formats = ['%aN', '%aE', '%s', '%cD', '%b'] |
266 targets = ['author', 'email', 'subject', 'date', 'body'] | 266 targets = ['author', 'email', 'subject', 'date', 'body'] |
267 | 267 |
268 for i in xrange(len(formats)): | 268 for i in xrange(len(formats)): |
269 cmd = ['log', '--format=%s' % formats[i], '-1', revision] | 269 cmd = ['log', '--format=%s' % formats[i], '-1', revision] |
270 output = bisect_utils.CheckRunGit(cmd, cwd=cwd) | 270 output = bisect_utils.CheckRunGit(cmd, cwd=cwd) |
271 commit_info[targets[i]] = output.rstrip() | 271 commit_info[targets[i]] = output.rstrip() |
272 | 272 |
273 return commit_info | 273 return commit_info |
274 | 274 |
275 def CheckoutFileAtRevision(self, file_name, revision, cwd=None): | 275 def CheckoutFileAtRevision(self, file_name, revision, cwd=None): |
(...skipping 25 matching lines...) Expand all Loading... |
301 revision_end: End of revision range. | 301 revision_end: End of revision range. |
302 | 302 |
303 Returns: | 303 Returns: |
304 Returns a list of commits that touched this file. | 304 Returns a list of commits that touched this file. |
305 """ | 305 """ |
306 cmd = ['log', '--format=%H', '%s~1..%s' % (revision_start, revision_end), | 306 cmd = ['log', '--format=%H', '%s~1..%s' % (revision_start, revision_end), |
307 '--', filename] | 307 '--', filename] |
308 output = bisect_utils.CheckRunGit(cmd) | 308 output = bisect_utils.CheckRunGit(cmd) |
309 | 309 |
310 return [o for o in output.split('\n') if o] | 310 return [o for o in output.split('\n') if o] |
OLD | NEW |