Chromium Code Reviews| Index: Tools/AutoSheriff/scripts/repositories.js |
| diff --git a/Tools/AutoSheriff/scripts/repositories.js b/Tools/AutoSheriff/scripts/repositories.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ad423420661a46e436f7f045947c195be76c3324 |
| --- /dev/null |
| +++ b/Tools/AutoSheriff/scripts/repositories.js |
| @@ -0,0 +1,62 @@ |
| +var repositories = repositories || {}; |
| + |
|
ojan
2014/07/22 02:01:26
Add a FIXME to move this somewhere shared? We'll n
|
| +(function(){ |
| + |
| +var registry = [ |
| + { |
| + 'name': 'chromium', |
| + 'short_name': 'cr', |
| + 'change_url': 'http://crrev.com/%s', |
| + 'changelog_url': 'http://build.chromium.org/f/chromium/perf/dashboard/ui/changelog.html?url=/trunk&range=%s:%s', |
| + }, |
| + { |
| + 'name': 'blink', |
| + 'short_name': 'bl', |
| + 'change_url': 'https://src.chromium.org/viewvc/blink?view=revision&revision=%s', |
| + 'changelog_url': 'http://build.chromium.org/f/chromium/perf/dashboard/ui/changelog_blink.html?url=/trunk&range=%s:%s', |
| + }, |
| + { |
| + 'name': 'v8', |
| + 'short_name': 'v8', |
| + 'change_url': 'https://code.google.com/p/v8/source/detail?r=%s', |
| + 'changelog_url': 'http://build.chromium.org/f/chromium/perf/dashboard/ui/changelog_v8.html?url=/trunk&range=%s:%s', |
| + }, |
| + { |
| + 'name': 'nacl', |
| + 'short_name': 'nacl', |
| + 'change_url': 'https://code.google.com/p/nativeclient/source/detail?r=%s', |
| + // changelog_nacl doesn't actually work yet. |
| + 'changelog_url': 'http://build.chromium.org/f/chromium/perf/dashboard/ui/changelog_nacl.html?url=/trunk&range=%s:%s', |
| + }, |
| + { |
| + // Skia, for whatever reason, isn't exposed in the buildbot properties |
| + // so we never hit this code. |
| + 'name': 'skia', |
| + 'short_name': 'sk', |
| + 'change_url': 'https://code.google.com/p/skia/source/detail?r=%s', |
| + 'changelog_url': 'http://build.chromium.org/f/chromium/perf/dashboard/ui/changelog_skia.html?url=/trunk&range=%s:%s', |
| + } |
| +] |
| + |
| +function entry_by_name(repo_name) { |
| + 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
|
| + if (registry[i].name == repo_name) |
| + return registry[i]; |
| + } |
| + console.log('No repo named ' + repo_name) |
| + return null; |
| +} |
| + |
| +repositories.change_url = function(repo_name, revision) { |
| + return entry_by_name(repo_name).change_url.replace('%s', revision); |
| +} |
| + |
| +repositories.changelog_url = function(repo_name, start, end) { |
| + return entry_by_name(repo_name).changelog_url.replace('%s', start).replace('%s', end); |
| +} |
| + |
| +repositories.short_name = function(repo_name) { |
| + return entry_by_name(repo_name).short_name; |
| +} |
| + |
| +})(); |