Skip to content

Commit

Permalink
Add some docstrings to GitPoller.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomprince committed Jun 19, 2012
1 parent 3a7b46a commit d438d65
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion master/buildbot/changes/gitpoller.py
Expand Up @@ -97,7 +97,7 @@ def make_dir(_):
def git_init(_):
log.msg('gitpoller: initializing working dir from %s' % self.repourl)
d = utils.getProcessOutputAndValue(self.gitbin,
['init', self.workdir], env=os.environ)
['init', '--bare', self.workdir], env=os.environ)
d.addCallback(self._convert_nonzero_to_failure)
d.addErrback(self._stop_on_failure)
return d
Expand Down Expand Up @@ -218,6 +218,7 @@ def process(git_output):
return d

def _get_changes(self):
"""Fetch changes from remote repository."""
log.msg('gitpoller: polling git repo at %s' % self.repourl)

self.lastPoll = time.time()
Expand All @@ -238,6 +239,13 @@ def _get_changes(self):

@defer.inlineCallbacks
def _process_changes(self, unused_output):
"""
Read changes since last change.
- Read list of commit hashes.
- Extract details from each commit.
- Add changes to database.
"""
# get the change list
revListArgs = ['log', '%s..origin/%s' % (self.branch, self.branch), r'--format=%H']
self.changeCount = 0
Expand Down Expand Up @@ -291,6 +299,7 @@ def _process_changes_failure(self, f):
return None

def _catch_up(self, res):
"""Update repository to record last seen change."""
if self.changeCount == 0:
log.msg('gitpoller: no changes, no catch_up')
return
Expand Down

0 comments on commit d438d65

Please sign in to comment.