OLD | NEW |
---|---|
1 URL: http://buildbot.net/trac | 1 URL: http://buildbot.net/trac |
2 Version: 0.8.4p1 | 2 Version: 0.8.4p1 |
3 License: GNU General Public License (GPL) Version 2 | 3 License: GNU General Public License (GPL) Version 2 |
4 | 4 |
5 This is a forked copy of buildbot v0.8.4p1. | 5 This is a forked copy of buildbot v0.8.4p1. |
6 | 6 |
7 Make hidden steps stay hidden even if not finished, add brDoStepIf | 7 Make hidden steps stay hidden even if not finished, add brDoStepIf |
8 to support buildrunner. | 8 to support buildrunner. |
9 | 9 |
10 | 10 |
(...skipping 2898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2909 import pyximport | 2909 import pyximport |
2910 @@ -28,6 +29,8 @@ except ImportError: | 2910 @@ -28,6 +29,8 @@ except ImportError: |
2911 print 'Unable to load the epoll module, falling back to select.' | 2911 print 'Unable to load the epoll module, falling back to select.' |
2912 print 'This may be caused by the lack of cython, python-dev, or' | 2912 print 'This may be caused by the lack of cython, python-dev, or' |
2913 print 'you may be on a platform other than linux 2.6' | 2913 print 'you may be on a platform other than linux 2.6' |
2914 +except twisted.internet.error.ReactorAlreadyInstalledError: | 2914 +except twisted.internet.error.ReactorAlreadyInstalledError: |
2915 + pass | 2915 + pass |
2916 | 2916 |
2917 from zope.interface import implements | 2917 from zope.interface import implements |
2918 from twisted.python import log, components | 2918 from twisted.python import log, components |
2919 | |
2920 | |
2921 Speed up slave JSON construction. | |
2922 | |
2923 diff --git a/third_party/buildbot_8_4p1/buildbot/status/web/status_json.py b/thi rd_party/buildbot_8_4p1/buildbot/status/web/status_json.py | |
2924 index 87a7f2d..09fa54f 100644 | |
2925 --- a/third_party/buildbot_8_4p1/buildbot/status/web/status_json.py | |
2926 +++ b/third_party/buildbot_8_4p1/buildbot/status/web/status_json.py | |
2927 @@ -623,7 +623,7 @@ class SlaveJsonResource(JsonResource): | |
2928 """ | |
2929 pageTitle = 'Slave' | |
2930 | |
2931 - def __init__(self, status, slave_status, buildcache=None): | |
2932 + def __init__(self, status, slave_status, buildcache): | |
2933 JsonResource.__init__(self, status) | |
2934 self.slave_status = slave_status | |
2935 self.name = self.slave_status.getName() | |
2936 @@ -631,9 +631,8 @@ class SlaveJsonResource(JsonResource): | |
2937 | |
2938 # buildcache is used to cache build information across multiple | |
2939 # invocations of SlaveJsonResource. It should be set to an empty | |
2940 - # collections.defaultdict(dict). Without it, each invocation will | |
2941 - # do a full build scan. | |
2942 - self.buildcache = buildcache or collections.defaultdict(dict) | |
2943 + # collections.defaultdict(dict). | |
2944 + self.buildcache = buildcache | |
2945 | |
2946 def getBuilders(self): | |
2947 if self.builders is None: | |
2948 @@ -644,22 +643,19 @@ class SlaveJsonResource(JsonResource): | |
2949 self.builders.append(builderName) | |
2950 return self.builders | |
2951 | |
2952 - def mapSlavesToBuilds(self): | |
2953 - for builderName in self.getBuilders(): | |
2954 - builder_status = self.status.getBuilder(builderName) | |
2955 - for i in range(1, builder_status.buildCacheSize - 1): | |
2956 - build_status = builder_status.getBuild(-i) | |
2957 - if not build_status or not build_status.isFinished(): | |
2958 - # If not finished, it will appear in runningBuilds. | |
2959 - break | |
Isaac (away)
2013/04/06 01:35:08
This does not look like the diff from origin.
| |
2960 - slave = self.buildcache[build_status.getSlavename()] | |
2961 - slave.setdefault(builderName, []).append( | |
2962 - build_status.getNumber()) | |
2963 - | |
2964 def getSlaveBuildMap(self): | |
2965 if not self.buildcache: | |
2966 - self.mapSlavesToBuilds() | |
2967 + for builderName in self.getBuilders(): | |
2968 + builds = [] | |
2969 + builder_status = self.status.getBuilder(builderName) | |
2970 + for i in range(1, builder_status.buildCacheSize - 1): | |
2971 + build_status = builder_status.getBuild(-i) | |
2972 + if not build_status or not build_status.isFinished(): | |
2973 + # If not finished, it will appear in runningBuilds. | |
2974 + break | |
2975 + slave = self.buildcache[build_status.getSlavename()] | |
2976 + slave.setdefault(builderName, []).append( | |
2977 + build_status.getNumber()) | |
2978 return self.buildcache[self.name] | |
2979 | |
2980 def asDict(self, request): | |
OLD | NEW |