Chromium Code Reviews| Index: tools/auto_bisect/source_control.py |
| diff --git a/tools/auto_bisect/source_control.py b/tools/auto_bisect/source_control.py |
| index 541287f29c06cb1c75323eedc69d201125d917fa..bf2db3f2168df75cd4893616962c7b5033e93a3d 100644 |
| --- a/tools/auto_bisect/source_control.py |
| +++ b/tools/auto_bisect/source_control.py |
| @@ -5,7 +5,6 @@ |
| """This module contains the SourceControl class and related functions.""" |
| import os |
| -import re |
| from . import bisect_utils |
| @@ -207,11 +206,10 @@ class GitSourceControl(SourceControl): |
| return log_output == "master" |
| def SVNFindRev(self, git_revision, cwd=None): |
|
qyearsley
2014/09/10 01:04:14
This should be renamed now -- maybe "GetCommitPosi
prasadv
2014/09/10 17:16:32
Right now git footers command get commit position
|
| - """Finds a SVN revision OR git number for the given git hash. |
| + """Finds a SVN revision OR Commit-Postion number for the given git hash. |
|
qyearsley
2014/09/10 01:04:14
We could just say git commit position, instead of
prasadv
2014/09/10 17:16:33
Done.
|
| - If "git svn find_rev <hash>" fails, then it runs |
| - "git log --format=%b -1 origin/master <hash> and greps for |
| - Cr-Commit-Position. |
| + This function executes "git footer --position-num <git hash>" command to get |
| + Commit-Position number(if available) or SVN revision of the given revision. |
| Args: |
| git_revision: The git SHA1 to use. |
|
qyearsley
2014/09/10 01:04:14
Should add a line for "cwd" here -- its purpose is
prasadv
2014/09/10 17:16:33
Done.
|
| @@ -220,27 +218,13 @@ class GitSourceControl(SourceControl): |
| Git number (aka git commit position) OR an SVN revision as integer, |
|
qyearsley
2014/09/10 01:04:14
You could just say "A git commit position number o
prasadv
2014/09/10 17:16:33
Done.
|
| otherwise None. |
| """ |
| - |
| - cmd = ['svn', 'find-rev', git_revision] |
| - |
| + cmd = ['footers', '--position-num', git_revision] |
| output = bisect_utils.CheckRunGit(cmd, cwd) |
| svn_revision = output.strip() |
|
qyearsley
2014/09/10 01:04:13
Call this commit_position instead of svn_revision.
prasadv
2014/09/10 17:16:33
Done.
|
| if bisect_utils.IsStringInt(svn_revision): |
| return int(svn_revision) |
| - # Retrieve commit position number from git log body for the given revision. |
| - # TODO(prasadv): Use an appropriate command to find commit position instead |
| - # of parsing the log. Resolve this once 407316 is fixed. |
| - commit_position_pattern = 'Cr-Commit-Position: .*@\{#(?P<commit>[0-9]+)\}' |
| - cmd = ['log', '--format=%b', '-1', git_revision] |
| - output = bisect_utils.CheckRunGit(cmd, cwd=cwd) |
| - if output: |
| - version_re = re.compile(commit_position_pattern) |
| - commit_reg = version_re.search(output) |
| - if commit_reg and bisect_utils.IsStringInt(commit_reg.group('commit')): |
| - return int(commit_reg.group('commit')) |
| - |
| return None |
| def QueryRevisionInfo(self, revision, cwd=None): |