[Buildbot-commits] buildbot/buildbot/process base.py,1.50,1.51

Brian Warner warner at users.sourceforge.net
Fri May 6 04:42:44 UTC 2005


Update of /cvsroot/buildbot/buildbot/buildbot/process
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21843/buildbot/process

Modified Files:
	base.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-137
Creator:  Brian Warner <warner at monolith.lothar.com>

Merged from org.apestaart at thomas--buildbot (patch 0-2), warner at monolith.lothar.com--2005 (patch 0-3)

Merged in Change(tag=) enhancement from Thomas Vander Stichele.

Patches applied:

 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--base-0
   tag of org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2

 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--patch-1
   tag of org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2

 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--base-0
   tag of org.apestaart at thomas--buildbot/buildbot--releases--0--patch-2

 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-1
   merge in first patch on the old cvsbranch branch

 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2
   merge in complete cvsbranch to this new branch

 * org.apestaart at thomas--buildbot/buildbot--releases--0--base-0
   tag of arch at buildbot.sf.net--2004/buildbot--dev--0--patch-21

 * org.apestaart at thomas--buildbot/buildbot--releases--0--patch-1
   merge in 0.6.3 release

 * org.apestaart at thomas--buildbot/buildbot--releases--0--patch-2
   merge in 0.6.4 release

 * org.apestaart at thomas/buildbot--cvsbranch--0--base-0
   tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2

 * org.apestaart at thomas/buildbot--cvsbranch--0--patch-1
   add "tag" concept to changes, and add isTagImportant to be overridden

 * org.apestaart at thomas/buildbot--cvsbranch--0--patch-2
   and add the file to test with

 * org.apestaart at thomas/buildbot--cvsbranch--0--patch-3
   clean up logging

 * org.apestaart at thomas/buildbot--cvsbranch--0--patch-4
   unboundlocalerror fix

 * warner at monolith.lothar.com--2005/buildbot--dev--0--base-0
   tag of arch at buildbot.sf.net--2004/buildbot--dev--0--patch-130

 * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-1
   Merged from arch at buildbot.sf.net--2004 (patch 131-136)

 * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-2
   Merged from org.apestaart at thomas--buildbot cvstag--0-dev (patch 0-2)

 * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-3
   add some docs, document Change(tag=)


Index: base.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/process/base.py,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- base.py	3 May 2005 20:02:03 -0000	1.50
+++ base.py	6 May 2005 04:42:41 -0000	1.51
@@ -101,11 +101,19 @@
         @param filename: name of a file to check, relative to the VC base
         @type  filename: string
       
-        @rtype: 0 or 1
+        @rtype: boolean
         @returns: whether the change to this file should trigger a rebuild
         """
-        return 1
-    
+        return True
+
+    def isTagImportant(self, tag):
+        """I return True if the given tag is important enough to trigger a
+        rebuild, False if it should be ignored. Override me to ignore
+        unimporant tags. The timer is not restarted, so a checkout may occur
+        in the middle of a set of changes marked 'unimportant'. Also, the
+        checkout may or may not pick up the 'unimportant' changes."""
+        return True
+     
     def bumpMaxChangeNumber(self, change):
         if not self.maxChangeNumber:
             self.maxChangeNumber = change.number
@@ -119,17 +127,24 @@
 
         @type  change: L{buildbot.changes.changes.Change}
         """
+        # for a change to be important, it needs to be with an important
+        # tag and it need to contain an important file
+
         important = 0
-        for filename in change.files:
-            if self.isFileImportant(filename):
-                important = 1
-                break
+
+        if self.isTagImportant(change.tag):
+            for filename in change.files:
+                if self.isFileImportant(filename):
+                    important = 1
+                    break
+
         if important:
             self.addImportantChange(change)
         else:
             self.addUnimportantChange(change)
 
     def addImportantChange(self, change):
+        log.msg("builder %s: change is important, adding" % self.builder.name)
         self.bumpMaxChangeNumber(change)
         self.changes.append(change)
         self.nextBuildTime = change.when + self.treeStableTimer





More information about the Commits mailing list