 from gitdh . modules import Module <EOL> from gitdh import git <EOL> from syslog import syslog , LOG_INFO , LOG_WARNING <EOL> class PostReceiveSource ( Module ) : <EOL> def isEnabled ( self , action ) : <EOL> return action == "<STR_LIT>" <EOL> def source ( self ) : <EOL> firstCommit = self . args [ <NUM_LIT:0> ] <EOL> lastCommit = self . args [ <NUM_LIT:1> ] <EOL> ref = self . args [ <NUM_LIT:2> ] <EOL> if ref . find ( "<STR_LIT>" ) == <NUM_LIT:0> : <EOL> branch = ref [ <NUM_LIT:11> : ] <EOL> else : <EOL> syslog ( LOG_WARNING , "<STR_LIT>" % ( ref , self . config . repoPath ) ) <EOL> return [ ] <EOL> try : <EOL> self . config . branches [ branch ] <EOL> except KeyError : <EOL> syslog ( LOG_INFO , "<STR_LIT>" % ( branch , self . config . repoPath ) ) <EOL> return [ ] <EOL> try : <EOL> gitRepo = git . Git ( self . config . repoPath ) <EOL> commits = gitRepo . getLog ( since = firstCommit , until = lastCommit , branch = branch ) <EOL> except git . GitException as e : 
 syslog ( LOG_WARNING , "<STR_LIT>" % ( e , ) ) 
 from gitdh . modules import Module <EOL> from gitdh import git <EOL> from syslog import syslog , LOG_INFO , LOG_WARNING <EOL> class PostReceiveSource ( Module ) : <EOL> def isEnabled ( self , action ) : <EOL> return action == "<STR_LIT>" <EOL> def source ( self ) : <EOL> firstCommit = self . args [ <NUM_LIT:0> ] <EOL> lastCommit = self . args [ <NUM_LIT:1> ] <EOL> ref = self . args [ <NUM_LIT:2> ] <EOL> if ref . find ( "<STR_LIT>" ) == <NUM_LIT:0> : <EOL> branch = ref [ <NUM_LIT:11> : ] <EOL> else : <EOL> syslog ( LOG_WARNING , "<STR_LIT>" % ( ref , self . config . repoPath ) ) <EOL> return [ ] <EOL> try : <EOL> self . config . branches [ branch ] <EOL> except KeyError : <EOL> syslog ( LOG_INFO , "<STR_LIT>" % ( branch , self . config . repoPath ) ) <EOL> return [ ] <EOL> try : <EOL> gitRepo = git . Git ( self . config . repoPath ) <EOL> commits = gitRepo . getLog ( since = firstCommit , until = lastCommit , branch = branch ) <EOL> except git . GitException as e : <EOL> syslog ( LOG_WARNING , "<STR_LIT>" % ( e , ) ) <EOL> return [ ] <EOL> for commit in commits : <EOL> commit . status = "<STR_LIT>" <EOL> return commits </s>
