Bug 975400 - Always set the status-firefoxXY flag when changes get uplifted (or integrated with the flag set to affected). r=graememcc
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Fri, 30 Jan 2015 15:38:26 -0800
changeset 1502 ee042d68178ee5b61c681c27b8b0fb92bde3042e
parent 1501 b17c1d831251a6262bad5ea3132fa915e5978898
child 1503 8926d3957c552f00c7ce0e8b43577d2ec6cb9ae9
push id870
push usermozilla@noorenberghe.ca
push dateFri, 30 Jan 2015 23:39:35 +0000
reviewersgraememcc
bugs975400
Bug 975400 - Always set the status-firefoxXY flag when changes get uplifted (or integrated with the flag set to affected). r=graememcc
mcmerge/js/Step.js
--- a/mcmerge/js/Step.js
+++ b/mcmerge/js/Step.js
@@ -39,17 +39,17 @@ function Step(name, callbacks, isBackout
   this.prependChosen = false;
   this.prependText = '';
 
   // The following are used for additional help text
   this.leaveOpenBugs = [];
   this.multiBugs = [];
   this.securityBugs = [];
   this.hasMilestones = [];
-  this.trackedBugs = [];
+  this.statusChangeBugs = [];
   this.haveComment = [];
 
   var options = {};
   if (Step.remaps.items > 0)
     options.test = true;
   this.unprivilegedLoader = bz.createClient(options);
 
   constructAttachedBugs(false);
@@ -556,18 +556,18 @@ Step.prototype.attachBugToCset = functio
     // Handle backouts when safe to do so
     if (PushData.safeToReopen() && bug && bug.canReopen) {
       this.bugInfo[bugID].canReopen = true;
       this.bugInfo[bugID].shouldReopen = true;
       attached.shouldComment = true;
     }
 
     // Release-tracking: determine if status-[tree]N can be set
-    if (bug && bug.isTracked && (bug.statusFlag == '---' || bug.statusFlag == 'affected')) {
-      if (isMC || Config.treeName == 'comm-central')
+    if (bug && (bug.statusFlag == '---' || bug.statusFlag == 'affected')) {
+      if ((bug.isTracked || bug.statusFlag == "affected") && (isMC || Config.treeName == 'comm-central'))
         this.bugInfo[bugID].canSetStatus = this.bugInfo[bugID].canResolve;
       else if (Config.treeInfo[Config.treeName].trackedTree)
         this.bugInfo[bugID].canSetStatus = true;
     } else if (bug && Config.treeInfo[Config.treeName].trackedTree && Config.treeInfo[Config.treeName].unconditionalFlag) {
         bug.isTracked = true;
         this.bugInfo[bugID].canSetStatus = true;
     }
 
@@ -606,25 +606,25 @@ Step.prototype.attachBugToCset = functio
 
   if (!(index in this.attachedBugs))
     this.attachedBugs[index] = {};
 
   var attachedBugs = this.attachedBugs[index];
   attachedBugs[bugID] = attached;
 
   // Release-tracking: determine if status-[tree]N should be set
-  if (bug && bug.isTracked)
+  if (bug)
     this.checkShouldSetStatus(bugID);
 
   // Various bits of state used for constructing additional help text
   if (this.bugInfo[bugID].linkedChangesets.length == 2)
     this.multiBugs.push(bugID);
   if (this.bugInfo[bugID].canSetStatus && this.bugInfo[bugID].shouldSetStatus &&
-      this.trackedBugs.indexOf(bugID) == -1)
-    this.trackedBugs.push(bugID);
+      this.statusChangeBugs.indexOf(bugID) == -1)
+    this.statusChangeBugs.push(bugID);
   if (!bug && this.securityBugs.indexOf(bugID) == -1)
     this.securityBugs.push(bugID);
   if (isMC && leaveOpen && this.leaveOpenBugs.indexOf(bugID) == -1)
     this.leaveOpenBugs.push(bugID);
   if (isMC && hasMilestone && this.hasMilestones.indexOf(bugID) == -1 &&
       this.bugInfo[bugID].canResolve)
     this.hasMilestones.push(bugID);
 };
@@ -668,25 +668,25 @@ Step.prototype.updateShouldSetStatusAfte
   if (!this.bugInfo[bugID].canSetStatus)
     return;
 
   // Resolve can't be toggled for aurora/beta etc trees, so if we're here after a resolve toggle
   // that implies m-c/c-c. Hence, if shouldResolve has been switched off, we can immediately decide
   // that we can't set the status
   if (!should) {
     this.bugInfo[bugID].shouldSetStatus = false;
-    removeFromArr(this.trackedBugs);
+    removeFromArr(this.statusChangeBugs);
     return;
   }
 
   this.checkShouldSetStatus(bugID);
-  if (this.bugInfo[bugID].shouldSetStatus && this.trackedBugs.indexOf(bugID) == -1)
-    this.trackedBugs.push(bugID);
+  if (this.bugInfo[bugID].shouldSetStatus && this.statusChangeBugs.indexOf(bugID) == -1)
+    this.statusChangeBugs.push(bugID);
   else if (!this.bugInfo[bugID].shouldSetStatus)
-    removeFromArr(this.trackedBugs);
+    removeFromArr(this.statusChangeBugs);
 };
 
 
 Step.prototype.setShouldResolve = function Step_setShouldResolve(bugID, should) {
   if (!(bugID in this.bugInfo))
     return;
 
   this.bugInfo[bugID].shouldResolve = should;
@@ -792,20 +792,20 @@ Step.prototype.updateShouldSetStatusAfte
 
     arr.splice(i, 1);
   }
 
   if (!this.bugInfo[bugID].canSetStatus)
     return;
 
   this.checkShouldSetStatus(bugID);
-  if (this.bugInfo[bugID].shouldSetStatus && this.trackedBugs.indexOf(bugID) == -1)
-    this.trackedBugs.push(bugID);
+  if (this.bugInfo[bugID].shouldSetStatus && this.statusChangeBugs.indexOf(bugID) == -1)
+    this.statusChangeBugs.push(bugID);
   else if (!this.bugInfo[bugID].shouldSetStatus)
-    removeFromArr(this.trackedBugs);
+    removeFromArr(this.statusChangeBugs);
 };
 
 
 Step.prototype.setShouldComment = function Step_setShouldComment(index, bugID, should) {
   if (!this.isAttached(index, bugID))
     return;
 
   this.attachedBugs[index][bugID].shouldComment = should;
@@ -896,17 +896,17 @@ Step.prototype.detachBugFromCset = funct
       return;
 
     arr.splice(i, 1);
   }
 
   if (this.bugInfo[bugID].linkedChangesets.length == 0) {
     removeFromArr(this.securityBugs);
     removeFromArr(this.leaveOpenBugs);
-    removeFromArr(this.trackedBugs);
+    removeFromArr(this.statusChangeBugs);
     delete this.bugInfo[bugID];
   } else if (this.bugInfo[bugID].linkedChangesets.length == 1)
     removeFromArr(this.multiBugs);
 };
 
 
 // Convenience function for constructing correctly pluralised text
 // for the help text, based on the contents of the given array
@@ -952,17 +952,17 @@ Step.prototype.constructTextFor = functi
 Step.prototype.getAdditionalHelpText = function Step_getAdditionalHelpText() {
   var text = '';
 
   var multiPost = ' associated with multiple changesets: the individual comments will be coalesced into a single comment.';
   var leaveOpenPost = ' "leave open" in the whiteboard, so the resolve flag has not been set.';
   var securityPost = ' restricted - mcMerge was unable to load the relevant information from Bugzilla.';
   var milestonePost = ' a milestone set. You may wish to check it is correct before submitting.';
   var alreadyCommentPost = ' to have already been commented with the correct changeset URL, so commenting there has been disabled.';
-  var trackedPost = ' ' + mcMerge.trackingFlag + '+, so ' + mcMerge.statusFlag + ' will be set to "fixed".';
+  var statusChangePost = ' tracked or uplifted and will have ' + mcMerge.statusFlag + ' set to "fixed".';
 
   var hashave = {singular: 'has', plural: 'have'};
   var appearTo = {singular: 'appears', plural: 'appear'};
   var isare = {singular: 'is', plural: 'are'};
   var already = {singular: 'already has', plural: 'already have'};
 
   if (this.multiBugs.length > 0 || this.leaveOpenBugs.length > 0 ||
       this.securityBugs.length > 0)
@@ -978,18 +978,18 @@ Step.prototype.getAdditionalHelpText = f
     text += this.constructTextFor(this.securityBugs, securityPost);
 
   if (this.haveComment.length > 0)
     text += this.constructTextFor(this.haveComment, alreadyCommentPost, appearTo, true);
 
   if (this.hasMilestones.length > 0)
     text += this.constructTextFor(this.hasMilestones, milestonePost, already, true);
 
-  if (this.trackedBugs.length > 0 && !Config.treeInfo[Config.treeName].unconditionalFlag)
-    text += this.constructTextFor(this.trackedBugs, trackedPost, isare);
+  if (this.statusChangeBugs.length > 0 && !Config.treeInfo[Config.treeName].unconditionalFlag)
+    text += this.constructTextFor(this.statusChangeBugs, statusChangePost, isare);
 
   return text;
 };
 
 
 Step.prototype.setStepNumber = function Step_setStepNumber(num) {
   this.stepNumber = num;
 };
@@ -1021,17 +1021,17 @@ Step.prototype.getHeading = function Ste
 
 // Return the user-visible help text to be shown for this step
 Step.prototype.getHelpText = function Step_getHelpText() {
   var helpText = '';
   if (this.name in Step.helpTexts)
     helpText = Step.helpTexts[this.name];
   helpText += this.getAdditionalHelpText();
 
-  if (this.trackedBugs.length > 0 && Config.treeInfo[Config.treeName].unconditionalFlag)
+  if (this.statusChangeBugs.length > 0 && Config.treeInfo[Config.treeName].unconditionalFlag)
     helpText += '<br>- Submitted bugs will have ' + mcMerge.statusFlag + ' set to "fixed"';
 
   if (Step.remaps && 'items' in Step.remaps && Step.remaps.items > 0)
     helpText += '<br><strong>Note: You are in debug mode. Only remap bugs will be submitted, and will be submitted to landfill.bugzilla.org!</strong>';
   return helpText;
 };