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

Unified Diff: verification/project_base.py

Issue 6813044: Add relative path support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/commit-queue
Patch Set: Created 9 years, 8 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 | « tests/project_base_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: verification/project_base.py
diff --git a/verification/project_base.py b/verification/project_base.py
index 34ff5e29927453f204876d7b8fb7fd8eab6794e6..5863ac33acb10bbf40cdd6072b932bc68db04382 100644
--- a/verification/project_base.py
+++ b/verification/project_base.py
@@ -5,8 +5,12 @@
"""Ignores issues not using the right project base url regex."""
import logging
+import os
import re
+import find_depot_tools # pylint: disable=W0611
+import breakpad
+
from verification import base
@@ -19,10 +23,19 @@ class ProjectBaseUrlVerifier(base.Verifier):
self.project_bases = project_bases
def verify(self, pending, revision):
- if not any(re.match(r, pending.base_url) for r in self.project_bases):
+ matches = filter(
+ None, (re.match(r, pending.base_url) for r in self.project_bases))
+ if not matches:
logging.info('%s not in whitelist' % pending.base_url)
state = base.IGNORED
else:
+ if len(matches) != 1:
+ breakpad.SendStack(
+ Exception('pending.base_url triggered multiple matches'), '')
+ match = matches[0]
+ if match.lastindex:
+ pending.relpath = match.group(match.lastindex).lstrip('/').replace(
+ '/', os.sep)
state = base.SUCCEEDED
pending.verifications[self.name] = base.SimpleStatus(state)
« no previous file with comments | « tests/project_base_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698