cobalt.py

changeset 66
74d8ca04ff01
parent 65
20bd76353eb5
child 67
f8cc57c608e2
equal deleted inserted replaced
65:20bd76353eb5 66:74d8ca04ff01
261 check_repo_exists ('zandronum-stable', 'Torr_Samaho') 261 check_repo_exists ('zandronum-stable', 'Torr_Samaho')
262 check_repo_exists ('zandronum-sandbox', 'crimsondusk') 262 check_repo_exists ('zandronum-sandbox', 'crimsondusk')
263 check_repo_exists ('zandronum-sandbox-stable', 'crimsondusk') 263 check_repo_exists ('zandronum-sandbox-stable', 'crimsondusk')
264 check_repo_exists ('zandronum-everything', '') 264 check_repo_exists ('zandronum-everything', '')
265 265
266 repocheck_timeout = {(time.time()) + 15} 266 repocheck_timeout = (time.time()) + 15
267 267
268 def get_commit_data (zanrepo, rev, template): 268 def get_commit_data (zanrepo, rev, template):
269 return zanrepo.hg_command ('log', '-l', '1', '-r', rev, '--template', template) 269 return zanrepo.hg_command ('log', '-l', '1', '-r', rev, '--template', template)
270 #enddef 270 #enddef
271 271
317 return '' 317 return ''
318 #enddef 318 #enddef
319 319
320 ' Retrieves and processes commits for zandronum repositories ' 320 ' Retrieves and processes commits for zandronum repositories '
321 ' Ensure both repositories are OK before using this! ' 321 ' Ensure both repositories are OK before using this! '
322 def process_zan_repo_updates (repo_name): 322 def process_zan_repo_updates():
323 result = 0
324
325 for n in ['zandronum-stable', 'zandronum', 'zandronum-sandbox', 'zandronum-sandbox-stable']:
326 result += process_one_repo (n)
327
328 return result
329
330 def process_one_repo (repo_name):
323 global repocheck_timeout 331 global repocheck_timeout
324 global suds_client 332 global suds_client
325 global g_clients 333 global g_clients
326 334
327 hgns = Config.get_node ('hg') 335 hgns = Config.get_node ('hg')
680 688
681 # Check for new issues on the bugtracker 689 # Check for new issues on the bugtracker
682 bt_checklatest() 690 bt_checklatest()
683 691
684 # Check for new commits in the repositories 692 # Check for new commits in the repositories
685 for n in ['zandronum-stable', 'zandronum', 'zandronum-sandbox', 'zandronum-sandbox-stable']: 693 process_zan_repo_updates()
686 process_zan_repo_updates (n)
687 694
688 def channel_by_name (self, name): 695 def channel_by_name (self, name):
689 for channel in self.channels: 696 for channel in self.channels:
690 if channel.get_value ('name').upper() == args[0].upper(): 697 if channel.get_value ('name').upper() == args[0].upper():
691 return channel 698 return channel
815 raise logical_exception ("usage: .%s <ticket>" % command) 822 raise logical_exception ("usage: .%s <ticket>" % command)
816 self.announce_ticket (bt_getissue (args[0])) 823 self.announce_ticket (bt_getissue (args[0]))
817 elif command == 'checkhg': 824 elif command == 'checkhg':
818 check_admin (sender, ident, host, command) 825 check_admin (sender, ident, host, command)
819 global repocheck_timeout 826 global repocheck_timeout
820 repocheck_timeout = {'zandronum':0, 'zandronum-stable':0, 'zandronum-sandbox':0, 'zandronum-sandbox-stable':0} 827 repocheck_timeout = 0
821 828 numcommits = process_zan_repo_updates()
822 for n in ['zandronum-stable', 'zandronum', 'zandronum-sandbox', 'zandronum-sandbox-stable']: 829
823 numcommits = process_zan_repo_updates (n) 830 if numcommits == 0:
824 831 self.privmsg (replyto, 'No new commits in ' + n)
825 if numcommits == 0: 832 #fi
826 self.privmsg (replyto, 'No new commits in ' + n)
827 #fi
828 #done
829 elif command == 'die': 833 elif command == 'die':
830 check_admin (sender, ident, host, command) 834 check_admin (sender, ident, host, command)
831 quit() 835 quit()
832 elif command == 'convert': 836 elif command == 'convert':
833 if len(args) != 3 or args[1] != 'as': 837 if len(args) != 3 or args[1] != 'as':

mercurial