changeset 119:bc1bd60006a0

hopefully really add some metadata
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 22 Jan 2011 18:20:58 -0800
parents f1056192bedb
children 9f7e39e52739
files autobot/changes/poller.py
diffstat 1 files changed, 13 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/autobot/changes/poller.py	Sat Jan 22 18:15:40 2011 -0800
+++ b/autobot/changes/poller.py	Sat Jan 22 18:20:58 2011 -0800
@@ -195,22 +195,24 @@
         self.commitInfo = {}
         log.msg('%s: processing change %s (something=%s)' % (self.name, rev, something))
         d = defer.succeed(None)
+        d.addCallback(self._get_commit_timestamp, rev)
+        d.addCallback(self._get_commit_name, rev)
+        d.addCallback(self._get_commit_files, rev)
+        d.addCallback(self._get_commit_comments, rev)
+        d.addCallback(self._add_change, rev)
+
         return d
         # get metadata
 #             dl = defer.DeferredList([
-#                 self._get_commit_timestamp(rev),
-#                 self._get_commit_name(rev),
-#                 self._get_commit_files(rev),
-#                 self._get_commit_comments(rev),
 #                 ], consumeErrors=True)
 
 #             # add the change, apparently
 #             dl.addCallback(self._add_change, rev)
         
 
-    def _add_change(self, change):
-        log.msg("_add_change results")
-
+    def _add_change(self, _, change):
+        log.msg("_add_change results: %s" % self.commitInfo)
+        
         
 
         # send the change to the master
@@ -319,7 +321,7 @@
 
     ### timestamp
 
-    def _get_commit_timestamp(self, rev):
+    def _get_commit_timestamp(self, _, rev):
         # unix timestamp
         args = ['log', '-r', rev, '--template', '{date|hgdate}']
         d = utils.getProcessOutput(self.binary, args, path=self.workdir, env=dict(PATH=os.environ['PATH']), errortoo=False )
@@ -341,7 +343,7 @@
 
     ### commit author ('name')
 
-    def _get_commit_name(self, rev):
+    def _get_commit_name(self, _, rev):
         """get the author of a commit"""
         args = ['log', '-r', rev, '--template', '{author}']
         d = utils.getProcessOutput(self.binary, args, path=self.workdir, env=dict(PATH=os.environ['PATH']), errortoo=False )
@@ -357,7 +359,7 @@
 
     ### files
 
-    def _get_commit_files(self, rev):
+    def _get_commit_files(self, _, rev):
         """get the files associated with a commit"""
         args = ['log', '-r', rev, '--template', '{files}']
         d = utils.getProcessOutput(self.binary, args, path=self.workdir, env=dict(PATH=os.environ['PATH']), errortoo=False )
@@ -371,7 +373,7 @@
 
     ### comments
 
-    def _get_commit_comments(self, rev):
+    def _get_commit_comments(self, _, rev):
         """get the commit message"""
         args = ['log', '-r', rev, '--template', '{desc}']
         d = utils.getProcessOutput(self.binary, args, path=self.workdir, env=dict(PATH=os.environ['PATH']), errortoo=False )