| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from google.appengine.ext import ndb | 5 from google.appengine.ext import ndb |
| 6 | 6 |
| 7 from lib import time_util | 7 from libs import time_util |
| 8 | 8 |
| 9 | 9 |
| 10 class BaseSuspectedCL(ndb.Model): | 10 class BaseSuspectedCL(ndb.Model): |
| 11 """Represents base information about a suspected cl.""" | 11 """Represents base information about a suspected cl.""" |
| 12 | 12 |
| 13 # Repo or project name of the suspected CL, eg: chromium, etc. | 13 # Repo or project name of the suspected CL, eg: chromium, etc. |
| 14 repo_name = ndb.StringProperty(indexed=True) | 14 repo_name = ndb.StringProperty(indexed=True) |
| 15 | 15 |
| 16 # The Git hash revision of the suspected CL. | 16 # The Git hash revision of the suspected CL. |
| 17 revision = ndb.StringProperty(indexed=False) | 17 revision = ndb.StringProperty(indexed=False) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 39 instance = cls(key=cls._CreateKey(repo_name, revision)) | 39 instance = cls(key=cls._CreateKey(repo_name, revision)) |
| 40 instance.repo_name = repo_name | 40 instance.repo_name = repo_name |
| 41 instance.revision = revision | 41 instance.revision = revision |
| 42 instance.commit_position = commit_position | 42 instance.commit_position = commit_position |
| 43 instance.identified_time = time_util.GetUTCNow() | 43 instance.identified_time = time_util.GetUTCNow() |
| 44 return instance | 44 return instance |
| 45 | 45 |
| 46 @classmethod | 46 @classmethod |
| 47 def Get(cls, repo_name, revision): # pragma: no cover | 47 def Get(cls, repo_name, revision): # pragma: no cover |
| 48 return cls._CreateKey(repo_name, revision).get() | 48 return cls._CreateKey(repo_name, revision).get() |
| OLD | NEW |