Ticket #71: absolute-sourcestamps.patch

File absolute-sourcestamps.patch, 3.1 KB (added by dustin, 4 years ago)
  • buildbot/interfaces.py

    Sun Jan 13 21:14:02 EST 2008  dustin@zmanda.com
      * absolute-sourcestamps.patch
    diff -rN -u old-trunk/buildbot/interfaces.py new-trunk/buildbot/interfaces.py
    old new  
    9898        BuildRequests. This is called by a Build when it starts, to figure 
    9999        out what its sourceStamp should be.""" 
    100100 
     101    def getAbsoluteSourceStamp(self, got_revision): 
     102        """Get a new SourceStamp object reflecting the actual revision found 
     103        by a Source step.""" 
     104 
    101105    def getText(self): 
    102106        """Returns a list of strings to describe the stamp. These are 
    103107        intended to be displayed in a narrow column. If more space is 
     
    255259 
    256260    def getSourceStamp(): 
    257261        """Return a SourceStamp object which can be used to re-create 
    258         the source tree that this build used. 
     262        the source tree that this build used.  This method will 
     263        return an absolute SourceStamp if possible, and its results 
     264        may change as the build progresses.  Specifically, a "HEAD" 
     265        build may later be more accurately specified by an absolute 
     266        SourceStamp with the specific revision information. 
    259267 
    260268        This method will return None if the source information is no longer 
    261269        available.""" 
  • buildbot/process/builder.py

    diff -rN -u old-trunk/buildbot/process/builder.py new-trunk/buildbot/process/builder.py
    old new  
    692692        if not bs.isFinished(): 
    693693            return 
    694694 
    695         ss = bs.getSourceStamp() 
     695        ss = bs.getSourceStamp(absolute=True) 
    696696        req = base.BuildRequest(reason, ss, self.original.name) 
    697697        self.requestBuild(req) 
    698698 
  • buildbot/sourcestamp.py

    diff -rN -u old-trunk/buildbot/sourcestamp.py new-trunk/buildbot/sourcestamp.py
    old new  
    8080                                changes=changes) 
    8181        return newsource 
    8282 
     83    def getAbsoluteSourceStamp(self, got_revision): 
     84        return SourceStamp(branch=self.branch, revision=got_revision, patch=self.patch) 
     85 
    8386    def getText(self): 
    8487        # TODO: this won't work for VC's with huge 'revision' strings 
    8588        if self.revision is None: 
  • buildbot/status/builder.py

    diff -rN -u old-trunk/buildbot/status/builder.py new-trunk/buildbot/status/builder.py
    old new  
    945945            return None 
    946946        return self.builder.getBuild(self.number-1) 
    947947 
    948     def getSourceStamp(self): 
    949         return self.source 
     948    def getSourceStamp(self, absolute=False): 
     949        if not absolute or not self.properties.has_key('got_revision'): 
     950            return self.source 
     951        return self.source.getAbsoluteSourceStamp(self.properties['got_revision']) 
    950952 
    951953    def getReason(self): 
    952954        return self.reason