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

Unified Diff: scripts/master/buildbucket/buildbot_gateway.py

Issue 2157703002: buildbucket: support unique change urls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: nits Created 4 years, 5 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 | « scripts/master/buildbucket/__init__.py ('k') | scripts/master/buildbucket/changestore.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/master/buildbucket/buildbot_gateway.py
diff --git a/scripts/master/buildbucket/buildbot_gateway.py b/scripts/master/buildbucket/buildbot_gateway.py
index 2bd422475627e5149ed6eeb33e958c0d161c4967..c465e3bd2613660bee92c4bed85c1a60a9658224 100644
--- a/scripts/master/buildbucket/buildbot_gateway.py
+++ b/scripts/master/buildbucket/buildbot_gateway.py
@@ -90,6 +90,14 @@ class BuildbotGateway(object):
return [row.changeid for row in conn.execute(q)]
return self.master.db.pool.do(find)
+ def find_changes_by_revlink(self, revlink):
+ """Searches for Changes in database by |revlink| and returns change ids."""
+ def find(conn):
+ table = self.master.db.model.changes
+ q = sa.select([table.c.changeid]).where(table.c.revlink == revlink)
+ return [row.changeid for row in conn.execute(q)]
+ return self.master.db.pool.do(find)
+
@inlineCallbacks
def get_change_by_id(self, change_id):
"""Returns buildot.changes.changes.Change as Deferred for |change_id|."""
« no previous file with comments | « scripts/master/buildbucket/__init__.py ('k') | scripts/master/buildbucket/changestore.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698