[Buildbot-commits] [Buildbot] #1032: use getProcessOutput in gitpoller

Buildbot buildbot-devel at lists.sourceforge.net
Sun Oct 31 01:24:40 UTC 2010


#1032: use getProcessOutput in gitpoller
------------------------+---------------------------------------------------
Reporter:  dustin       |       Owner:       
    Type:  enhancement  |      Status:  new  
Priority:  major        |   Milestone:  0.8.3
 Version:  0.8.2        |    Keywords:  git  
------------------------+---------------------------------------------------

Comment(by matisse):

 So I muddled my way through and have a crude working version where I
 replaced all calls to _get_git_output().

 Basically what I have done is:

 - Added a new commitInfo attribute on the object. It is a hash:
   self.commitInfo = {}

 - Methods such as _get_commit_files() now use getProcessOutput() which
 creates a deferred, to which a callback is added that populates
 self.commitInfo['files'] - the deferred is then returned.

 - When a list of one or more revisions is found we loops over them (same
 behavior as now) and for each rev I call the 4 methods that need to get
 commit info (timestamp, files, name, comments) and each of those returns a
 deferred. I then make a  DeferredList with those and add a callback to it
 (which will fire only when all of the deferreds in the list are done) and
 that callback actually creates the changes.Change object, using data from
 self.commitInfo.

 Whew.
 It's probably a lame way to do this, it *seems* to work.

 I lament tremendously that I don't know how to get the test suite to run
 so that  could have done this using unit tests and not printf-debugging on
 my server! I feel so last-cenury.

 I need to get permission to post-back what i did so that those of you who
 actually know python and twistd can review my code and come up with the
 "right" way to do it.

-- 
Ticket URL: <http://buildbot.net/trac/ticket/1032#comment:3>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list