Bug 807670 comm-central hooks should now treat calendar/ checkins the same as Thunderbird ones. r=Fallen
authorMark Banner <bugzilla@standard8.plus.com>
Thu, 01 Nov 2012 16:00:33 +0000
changeset 145 b0866c8f9c377ae34cd7f1ac73be1d7456cc3548
parent 144 81840580bc958ea458f7b3247a924107b14e1606
child 146 7cff4a5772972946039596d93288136122947d7a
push id74
push userbugzilla@standard8.plus.com
push dateThu, 01 Nov 2012 16:00:58 +0000
reviewersFallen
bugs807670
Bug 807670 comm-central hooks should now treat calendar/ checkins the same as Thunderbird ones. r=Fallen
mozhghooks/treeclosure_comm_central.py
runtests.py
--- a/mozhghooks/treeclosure_comm_central.py
+++ b/mozhghooks/treeclosure_comm_central.py
@@ -16,22 +16,16 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 from urllib2 import urlopen
 import os.path
 import re
 import json
 
-# Array of which directories Calendar exclusively controls in comm-central
-calendarOwns = [
-  'calendar',
-  'other-licenses/branding/sunbird'
-]
-
 # Array of which directories SeaMonkey exclusively controls in comm-central
 seamonkeyOwns = [
   'suite'
 ]
 # Everything else is assumed to be controlled by Thunderbird.
 
 # SeaMonkey tinderbox trees
 seamonkeyTrees = {
@@ -42,34 +36,16 @@ seamonkeyTrees = {
   'comm-esr10'  : None,
   # Point at Mirmar as SeaMonkey doesn't use this
   'comm-miramar': None,
   'comm-2.0'    : 'http://tinderbox.mozilla.org/SeaMonkey2.1/status.html',
   'comm-1.9.1'  : 'http://tinderbox.mozilla.org/SeaMonkey2.0/status.html',
   # Point at Thunderbird as SeaMonkey doesn't use this.
   'comm-1.9.2'  : None,
 }
-# Calendar tinderbox trees
-calendarTrees = {
-  'comm-central': 'http://tinderbox.mozilla.org/CalendarTrunk/status.html',
-  # Point at Thunderbird for now
-  'comm-aurora' : 'http://tinderbox.mozilla.org/Calendar-Aurora/status.html',
-  # Point at Thunderbird for now
-  'comm-beta'   : 'http://tinderbox.mozilla.org/Calendar-Beta/status.html',
-  'comm-release': 'http://tinderbox.mozilla.org/Calendar-Release/status.html',
-  'comm-esr10'  : None,
-  'comm-miramar': None,
-  # Point at SeaMonkey as Calendar don't use this one
-  'comm-2.0'    : None,
-  # Point at Thunderbird as Calendar doesn't use this
-  'comm-1.9.2'  : None,
-  # Point at SeaMonkey as Calendar doesn't use this.
-  'comm-1.9.1'  : None,
-}
-
 
 magicwords = "CLOSED TREE"
 
 treestatus_base_url = "https://treestatus.mozilla.org"
 
 # This function actually does the checking to see if a tree is closed or set
 # to approval required.
 def checkTreeState(repo, repoName, treeName, treeUrl):
@@ -173,29 +149,26 @@ def isOwned(changedFile, ownerArray):
             return True
 
     return False
 
 def hook(ui, repo, node, **kwargs):
     try:
         # First find out which trees are affected
         apps = { 'thunderbird' : False,
-                 'seamonkey' : False,
-                 'calendar' : False }
+                 'seamonkey' : False }
 
         # all changesets from node to 'tip' inclusive are part of this push
         rev = repo.changectx(node).rev()
         tip = repo.changectx('tip').rev()
         for i in range(rev, tip+1):
             ctx = repo.changectx(i)
             for changedFile in ctx.files():
                 if isOwned(changedFile, seamonkeyOwns):
                     apps['seamonkey'] = True
-                elif isOwned(changedFile, calendarOwns):
-                    apps['calendar'] = True
                 else:
                     apps['thunderbird'] = True
 
         affectedTrees = []
         repoName = os.path.basename(repo.root)
         status = 0
 
         # This can be replaced by "for app in apps:" once all apps have switched.
@@ -208,23 +181,16 @@ def hook(ui, repo, node, **kwargs):
         if apps['seamonkey']:
             if not seamonkeyTrees.has_key(repoName):
                 print "Unrecognized tree!  I don't know how to check closed status for %s and SeaMonkey... allowing push, but you should report this!" % (repoName)
             else:
                 status = checkTreeState(repo, repoName, 'SeaMonkey', seamonkeyTrees[repoName])
                 if status == 1:
                     return 1
 
-        if apps['calendar']:
-            if not calendarTrees.has_key(repoName):
-                print "Unrecognized tree!  I don't know how to check closed status for %s and Calendar... allowing push, but you should report this!" % (repoName)
-            else:
-                 status = checkTreeState(repo, repoName, 'Calendar', calendarTrees[repoName])
-
         return status;
-        
             
     except IOError, (err):
         # fail open, I guess. no sense making hg unavailable
         # if the wiki is down
         print "IOError: %s" % err
         pass
     return 0
--- a/runtests.py
+++ b/runtests.py
@@ -389,21 +389,19 @@ class TestTreeCommCentralClosureHook(Clo
 
  
   def testCCOpenThunderbird(self):
     self.actualTestCCOpen("Thunderbird", ["testfile"])
 
   def testCCOpenSeaMonkey(self):
     self.actualTestCCOpen("SeaMonkey", ["suite", "build", "test"])
 
-  def testCCOpenCalendar1(self):
-    self.actualTestCCOpen("CalendarTrunk", ["calendar", "app", "test"])
-
-  def testCCOpenCalendar2(self):
-    self.actualTestCCOpen("CalendarTrunk", ["other-licenses", "branding", "sunbird", "test"])
+  def testCCOpenCalendar(self):
+    # Calendar is now built alongside Thunderbird
+    self.actualTestCCOpen("Thunderbird", ["calendar", "app", "test"])
 
   def actualTestCCClosed(self, treeName, fileInfo):
     """Pushing to a CLOSED CC tree should fail."""
     # If this tests attempts to pull something that isn't treeName, then the
     # re-director should fail for us. Hence we know that the hook is only
     # pulling the predefined tree and nothing else.
     if "Thunderbird" in treeName:
         self.redirect("https://treestatus.mozilla.org/comm-central-" + treeName.lower() + "?format=json",
@@ -430,21 +428,19 @@ class TestTreeCommCentralClosureHook(Clo
     self.assertEqual(self.director.opened, 1)
 
   def testCCClosedThunderbird(self):
     self.actualTestCCClosed("Thunderbird", ["testfile"])
 
   def testCCClosedSeaMonkey(self):
     self.actualTestCCClosed("SeaMonkey", ["suite", "build", "test"])
 
-  def testCCClosedCalendar1(self):
-    self.actualTestCCClosed("CalendarTrunk", ["calendar", "app", "test"])
-
-  def testCCClosedCalendar2(self):
-    self.actualTestCCClosed("CalendarTrunk", ["other-licenses", "branding", "sunbird", "test"])
+  def testCCClosedCalendar(self):
+    # Calendar is now built alongside Thunderbird
+    self.actualTestCCClosed("Thunderbird", ["calendar", "app", "test"])
 
   # In theory adding CLOSED TREE is the same code-path for all projects,
   # so just checking for one project
   def testCCClosedThunderbirdMagicWords(self):
     """
     Pushing to a CLOSED Thunderbird tree with 'CLOSED TREE' in the commit message
     should succeed.
     """