aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libbugzilla.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libbugzilla.js')
-rw-r--r--lib/libbugzilla.js30
1 files changed, 8 insertions, 22 deletions
diff --git a/lib/libbugzilla.js b/lib/libbugzilla.js
index bdcf8fb..6d556a4 100644
--- a/lib/libbugzilla.js
+++ b/lib/libbugzilla.js
@@ -61,7 +61,7 @@ function getRealBugNoSlow(bugNo, location, callback) {
onComplete: function(response) {
if (response.status === 200) {
var xmlRepr = parseXMLfromString(response.text);
- // TODO this is probably wrong, both XPath and .text attribute
+ // TODO this probably wrong, both XPath and .text attribute
var bugID = parseInt(xmlRepr.bug.bug_id.text, 10);
if (isNaN(bugID)) {
throw new Error("Cannot get bug no. even from XML representation!");
@@ -85,7 +85,7 @@ function getPassword(login, domain) {
withoutPass: false // whether user doesn't want to use password at all
};
- // pass === null means no appropriatjslie password in the storage
+ // pass === null means no appropriate password in the storage
if (!preferences.get(prefName,false) && (pass === null)) {
var passwordText = prompts.promptPassword(passPrompt);
if (passwordText && passwordText.length > 0) {
@@ -148,11 +148,10 @@ exports.getInstalledPackages = function getInstalledPackages(locationLoginObj, c
}
}
- if ((enabledPackages.length === 1) && (enabledPackages[0] === "all")) {
- enabledPackages = [];
- for (var key in config.gJSONData.commentPackages) {
- enabledPackages.push(key);
- }
+ var allIdx = null;
+ if ((allIdx = enabledPackages.indexOf("all")) != -1) {
+ enabledPackages = enabledPackages.splice(allIdx,
+ config.gJSONData.commentPackages.keys());
}
// TODO To be decided, whether we cannot just eliminate packages in
@@ -176,7 +175,8 @@ exports.getInstalledPackages = function getInstalledPackages(locationLoginObj, c
}
}
- if ("sentUpstreamString" in config.gJSONData.commentStrings) {
+ if (config.gJSONData.commentStrings &&
+ "sentUpstreamString" in config.gJSONData.commentStrings) {
config.constantData.commentStrings = {};
config.constantData.commentStrings.sentUpstreamString =
config.gJSONData.commentStrings["sentUpstreamString"];
@@ -326,25 +326,13 @@ exports.initialize = function initialize(config, callback) {
});
}
- // config.logger = new logger.Logger(JSON.parse(
- // self.data.load("bugzillalabelAbbreviations.json")));
-
config.configData = {};
config.configData.matches = config.gJSONData.configData.matches;
config.configData.skipMatches = config.configData.matches.map(function(x) {
return x.replace("show_bug.cgi.*","((process|post)_bug|attachment)\.cgi$");
});
- // config.objConstructor = {};
- // var bzType = config.gJSONData.configData.objectStyle;
- // if (bzType === "RH") {
- // config.objConstructor = require("rhbzpage").RHBugzillaPage;
- // } else if (bzType === "MoFo") {
- // }
- // config.objConstructor = require("mozillabzpage").MozillaBugzilla;
-
config.constantData = {};
- // TODO this is important and missing
if ("constantData" in config.gJSONData) {
config.constantData = config.gJSONData.constantData;
config.constantData.queryUpstreamBug = JSON.parse(
@@ -375,8 +363,6 @@ exports.initialize = function initialize(config, callback) {
if ("submitsLogging" in config.gJSONData.configData &&
config.gJSONData.configData.submitsLogging) {
- console.log("initialize : submitsLogin = " +
- config.gJSONData.configData.submitsLogging);
logger.initialize(JSON.parse(selfMod.data.load(
"bugzillalabelAbbreviations.json")));
}