Closed
Bug 611431
Opened 15 years ago
Closed 15 years ago
Give pushlog loading an error callback
Categories
(Tree Management Graveyard :: TBPL, defect)
Tree Management Graveyard
TBPL
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mstange, Assigned: mstange)
Details
Attachments
(1 file)
4.76 KB,
patch
|
Swatinem
:
review+
|
Details | Diff | Splinter Review |
Just for consistency's sake. The wdiff looks like this:
diff -p -U 8 -w -r -N tinderboxpushlog.085417b2fa86/js/Data.js tinderboxpushlog.cea04bfba66e/js/Data.js
--- tinderboxpushlog.085417b2fa86/js/Data.js 2010-11-11 20:08:27.000000000 +0100
+++ tinderboxpushlog.cea04bfba66e/js/Data.js 2010-11-11 20:08:27.000000000 +0100
@@ -45,16 +45,17 @@ Data.prototype = {
};
Config.pushlogDataLoader.load(
Config.repoNames[this._treeName],
timeOffset,
function hgDataLoadCallback(data) {
loadedData.pushes = data;
checkLoaded();
},
+ failCallback,
this._pusher,
this._rev
);
Config.tinderboxDataLoader.load(
this._treeName,
timeOffset,
this._noIgnore,
function tinderboxDataLoadCallback(data) {
diff -p -U 8 -w -r -N tinderboxpushlog.085417b2fa86/js/PushlogJSONParser.js tinderboxpushlog.cea04bfba66e/js/PushlogJSONParser.js
--- tinderboxpushlog.085417b2fa86/js/PushlogJSONParser.js 2010-11-11 20:08:27.000000000 +0100
+++ tinderboxpushlog.cea04bfba66e/js/PushlogJSONParser.js 2010-11-11 20:08:27.000000000 +0100
@@ -1,16 +1,19 @@
/* -*- Mode: JS; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=2 et tw=80 : */
var PushlogJSONParser = {
- load: function PushlogJSONParser_load(repoName, timeOffset, loadCallback, pusher, rev) {
+ load: function PushlogJSONParser_load(repoName, timeOffset, loadCallback, failCallback, pusher, rev) {
var self = this;
- $.getJSON(this._getLogUrl(repoName, timeOffset), function(data) {
+ $.ajax({
+ url: this._getLogUrl(repoName, timeOffset),
+ dataType: 'json',
+ success: function (data) {
var pushes = {};
for (var pushID in data) {
var push = data[pushID];
// Filter by pusher if requested.
if (pusher && push.user != pusher) {
continue;
}
@@ -45,16 +48,20 @@ var PushlogJSONParser = {
if (rev && !revFound) {
continue;
}
var toprev = patches[0].rev;
pushes[toprev] = {pusher: push.user, date: new Date(push.date * 1000), toprev: toprev, patches: patches};
}
loadCallback(pushes);
+ },
+ error: function (request, textStatus, error) {
+ failCallback(textStatus);
+ }
});
},
_getLogUrl: function PushlogJSONParser__getLogUrl(repoName, timeOffset) {
var startDate = timeOffset ? this._formattedDate(new Date((timeOffset - Config.goBackHours * 3600) * 1000)) : '12+hours+ago';
var endDate = timeOffset ? this._formattedDate(new Date(timeOffset * 1000)) : 'now';
return "http://hg.mozilla.org/" + repoName + "/json-pushes?full=1&startdate=" + startDate + "&enddate=" + endDate;
},
Attachment #489887 -
Flags: review?(arpad.borsos)
Updated•15 years ago
|
Attachment #489887 -
Flags: review?(arpad.borsos) → review+
Assignee | ||
Comment 1•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Product: Webtools → Tree Management
Updated•10 years ago
|
Product: Tree Management → Tree Management Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•