Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 var repositories = repositories || {}; | |
| 2 | |
|
ojan
2014/07/22 02:01:26
Add a FIXME to move this somewhere shared? We'll n
| |
| 3 (function(){ | |
| 4 | |
| 5 var registry = [ | |
| 6 { | |
| 7 'name': 'chromium', | |
| 8 'short_name': 'cr', | |
| 9 'change_url': 'http://crrev.com/%s', | |
| 10 'changelog_url': 'http://build.chromium.org/f/chromium/perf/dashboard/ui/cha ngelog.html?url=/trunk&range=%s:%s', | |
| 11 }, | |
| 12 { | |
| 13 'name': 'blink', | |
| 14 'short_name': 'bl', | |
| 15 'change_url': 'https://src.chromium.org/viewvc/blink?view=revision&revision= %s', | |
| 16 'changelog_url': 'http://build.chromium.org/f/chromium/perf/dashboard/ui/cha ngelog_blink.html?url=/trunk&range=%s:%s', | |
| 17 }, | |
| 18 { | |
| 19 'name': 'v8', | |
| 20 'short_name': 'v8', | |
| 21 'change_url': 'https://code.google.com/p/v8/source/detail?r=%s', | |
| 22 'changelog_url': 'http://build.chromium.org/f/chromium/perf/dashboard/ui/cha ngelog_v8.html?url=/trunk&range=%s:%s', | |
| 23 }, | |
| 24 { | |
| 25 'name': 'nacl', | |
| 26 'short_name': 'nacl', | |
| 27 'change_url': 'https://code.google.com/p/nativeclient/source/detail?r=%s', | |
| 28 // changelog_nacl doesn't actually work yet. | |
| 29 'changelog_url': 'http://build.chromium.org/f/chromium/perf/dashboard/ui/cha ngelog_nacl.html?url=/trunk&range=%s:%s', | |
| 30 }, | |
| 31 { | |
| 32 // Skia, for whatever reason, isn't exposed in the buildbot properties | |
| 33 // so we never hit this code. | |
| 34 'name': 'skia', | |
| 35 'short_name': 'sk', | |
| 36 'change_url': 'https://code.google.com/p/skia/source/detail?r=%s', | |
| 37 'changelog_url': 'http://build.chromium.org/f/chromium/perf/dashboard/ui/cha ngelog_skia.html?url=/trunk&range=%s:%s', | |
| 38 } | |
| 39 ] | |
| 40 | |
| 41 function entry_by_name(repo_name) { | |
| 42 for (var i = 0; i < registry.length; ++i) { | |
|
ojan
2014/07/22 02:01:26
If you had sugarjs you could use registery.find he
| |
| 43 if (registry[i].name == repo_name) | |
| 44 return registry[i]; | |
| 45 } | |
| 46 console.log('No repo named ' + repo_name) | |
| 47 return null; | |
| 48 } | |
| 49 | |
| 50 repositories.change_url = function(repo_name, revision) { | |
| 51 return entry_by_name(repo_name).change_url.replace('%s', revision); | |
| 52 } | |
| 53 | |
| 54 repositories.changelog_url = function(repo_name, start, end) { | |
| 55 return entry_by_name(repo_name).changelog_url.replace('%s', start).replace('%s ', end); | |
| 56 } | |
| 57 | |
| 58 repositories.short_name = function(repo_name) { | |
| 59 return entry_by_name(repo_name).short_name; | |
| 60 } | |
| 61 | |
| 62 })(); | |
| OLD | NEW |