diff options
author | Steve Block <steveblock@google.com> | 2010-05-26 10:11:43 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-05-27 11:14:42 +0100 |
commit | e78cbe89e6f337f2f1fe40315be88f742b547151 (patch) | |
tree | d778000b84a04f24bbad50c7fa66244365e960e9 /WebKitTools/Scripts/webkitpy/tool/bot | |
parent | 7b582e96e4e909ed7dba1e07153d20fbddaec3f7 (diff) | |
download | external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.zip external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.tar.gz external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.tar.bz2 |
Merge WebKit at r60074: Initial merge by git
Change-Id: I18a2dc5439e36c928351ea829d8fb4e39b062fc7
Diffstat (limited to 'WebKitTools/Scripts/webkitpy/tool/bot')
-rw-r--r-- | WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py b/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py index 9a2cdfa..6100cf8 100644 --- a/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py +++ b/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py @@ -1,4 +1,4 @@ -# Copyright (c) 2009 Google Inc. All rights reserved. +# Copyright (c) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -26,6 +26,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + class PersistentPatchCollectionDelegate: def collection_name(self): raise NotImplementedError, "subclasses must implement" @@ -56,9 +57,22 @@ class PersistentPatchCollection: self._status_cache[patch_id] = status return status - def next(self): + def _is_active_patch_id(self, patch_id): + """Active patches are patches waiting to be processed from this collection.""" + status = self._cached_status(patch_id) + return not status or not self._delegate.is_terminal_status(status) + + def _fetch_active_patch_ids(self): patch_ids = self._delegate.fetch_potential_patch_ids() - for patch_id in patch_ids: - status = self._cached_status(patch_id) - if not status or not self._delegate.is_terminal_status(status): - return patch_id + return filter(lambda patch_id: self._is_active_patch_id(patch_id), patch_ids) + + def next(self): + # Note: We only fetch all the ids so we can post them back to the server. + # This will go away once we have a feeder queue and all other queues are + # just pulling their next work item from the server. + patch_ids = self._fetch_active_patch_ids() + # FIXME: We're assuming self._name is a valid queue-name. + self._status.update_work_items(self._name, patch_ids) + if not patch_ids: + return None + return patch_ids[0] |