diff options
author | simonhatch@chromium.org <simonhatch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-07 00:25:06 +0000 |
---|---|---|
committer | simonhatch@chromium.org <simonhatch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-07 00:25:06 +0000 |
commit | 3b2e36584a8fb9712b7fc3e9cee78fb2dc6a3d69 (patch) | |
tree | b1ebd257d4f88028a67dff6653d289836cbbd104 /tools/bisect-perf-regression.py | |
parent | c6c074340a9c5707e4398ffb04d7fdf86c20c336 (diff) | |
download | chromium_src-3b2e36584a8fb9712b7fc3e9cee78fb2dc6a3d69.zip chromium_src-3b2e36584a8fb9712b7fc3e9cee78fb2dc6a3d69.tar.gz chromium_src-3b2e36584a8fb9712b7fc3e9cee78fb2dc6a3d69.tar.bz2 |
Made svn lookup more robust by searching over a range of commits when initially trying to resolve svn commits to git hashes.
BUG=
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/12550008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186549 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/bisect-perf-regression.py')
-rwxr-xr-x | tools/bisect-perf-regression.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/bisect-perf-regression.py b/tools/bisect-perf-regression.py index 2c490aa..0892fe7 100755 --- a/tools/bisect-perf-regression.py +++ b/tools/bisect-perf-regression.py @@ -292,7 +292,7 @@ class GitSourceControl(SourceControl): return not results[1] - def ResolveToRevision(self, revision_to_check, depot, search=1): + def ResolveToRevision(self, revision_to_check, depot, search): """If an SVN revision is supplied, try to resolve it to a git SHA1. Args: @@ -300,7 +300,8 @@ class GitSourceControl(SourceControl): resolved to a git SHA1. depot: The depot the revision_to_check is from. search: The number of changelists to try if the first fails to resolve - to a git hash. + to a git hash. If the value is negative, the function will search + backwards chronologically, otherwise it will search forward. Returns: A string containing a git SHA1 hash, otherwise None. @@ -316,7 +317,12 @@ class GitSourceControl(SourceControl): svn_revision = int(revision_to_check) git_revision = None - for i in xrange(svn_revision, svn_revision - search, -1): + if search > 0: + search_range = xrange(svn_revision, svn_revision + search, 1) + else: + search_range = xrange(svn_revision, svn_revision + search, -1) + + for i in search_range: svn_pattern = 'git-svn-id: %s@%d' %\ (depot_svn, i) cmd = ['log', '--format=%H', '-1', '--grep', svn_pattern, 'origin/master'] @@ -686,7 +692,7 @@ class BisectPerformanceMetrics(object): for d in DEPOT_DEPS_NAME[depot]['depends']: self.ChangeToDepotWorkingDirectory(d) - dependant_rev = self.source_control.ResolveToRevision(svn_rev, d, 1000) + dependant_rev = self.source_control.ResolveToRevision(svn_rev, d, -1000) if dependant_rev: revisions_to_sync.append([d, dependant_rev]) @@ -956,9 +962,9 @@ class BisectPerformanceMetrics(object): # If they passed SVN CL's, etc... we can try match them to git SHA1's. bad_revision = self.source_control.ResolveToRevision(bad_revision_in, - 'src') + 'src', 100) good_revision = self.source_control.ResolveToRevision(good_revision_in, - 'src') + 'src', -100) if bad_revision is None: results['error'] = 'Could\'t resolve [%s] to SHA1.' % (bad_revision_in,) |