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

Unified Diff: infra/services/lkgr_finder/lkgr_lib.py

Issue 491583004: Make CollateRevisionHistory handle git and svn at the same time. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fixed a bug where keyfunc throws exception when NOREV is passed. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/services/lkgr_finder/lkgr_lib.py
diff --git a/infra/services/lkgr_finder/lkgr_lib.py b/infra/services/lkgr_finder/lkgr_lib.py
index 25a948e8a8d1cacdbc61c5c661ba09fc8e6441c5..5914a42315db72d1e0cb0f1384d85634cebc11aa 100644
--- a/infra/services/lkgr_finder/lkgr_lib.py
+++ b/infra/services/lkgr_finder/lkgr_lib.py
@@ -121,6 +121,8 @@ class GitWrapper(VCSWrapper):
self._number_cache.update(dict(zip(revs, nums)))
def keyfunc(self, r): # pragma: no cover
+ if r is NOREV:
szager1 2014/08/20 19:09:55 agable and I can't understand why this is necessar
zty 2014/08/20 19:55:46 Acknowledged.
+ return -1
if not self.check_rev(r):
raise ValueError('%s is not a Git revision.' % r)
k = self._number_cache.get(r)
@@ -324,7 +326,14 @@ def CollateRevisionHistory(build_data, lkgr_builders, repo): # pragma: no cover
continue
revision = None
for prop in this_build_data.get('properties', []):
- if prop[0] == 'got_revision':
+ if type(repo) is SvnWrapper and prop[0] == 'got_revision':
+ revision = prop[1]
+ break
+ if type(repo) is GitWrapper and prop[0] == 'got_revision_git':
+ revision = prop[1]
+ break
+ # If repo is a project that depends on 'src'
+ if prop[0] == 'got_src_revision':
revision = prop[1]
break
if not revision:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698