299 global g_CommitsDb |
299 global g_CommitsDb |
300 |
300 |
301 for repo in all_repo_names(): |
301 for repo in all_repo_names(): |
302 check_repo_exists (repo) |
302 check_repo_exists (repo) |
303 |
303 |
|
304 g_CommitsDb = CommitsDb() |
304 repocheck_timeout = time.time() + 15 |
305 repocheck_timeout = time.time() + 15 |
305 g_CommitsDb = CommitsDb() |
|
306 |
306 |
307 global ZDoomRevNumber |
307 global ZDoomRevNumber |
308 try: |
308 try: |
309 ZDoomRevNumber = get_zdrev_number ('zandronum-merge-experiments', 'tip') |
309 ZDoomRevNumber = get_zdrev_number ('zandronum-merge-experiments', 'tip') |
310 except Exception as e: |
310 except Exception as e: |
419 try: |
419 try: |
420 existingrepos = g_CommitsDb.get_commit_repos (commit_node) |
420 existingrepos = g_CommitsDb.get_commit_repos (commit_node) |
421 alreadyAdded = len (existingrepos) > 0 |
421 alreadyAdded = len (existingrepos) > 0 |
422 |
422 |
423 delim = '@@@@@@@@@@' |
423 delim = '@@@@@@@@@@' |
424 data = get_commit_data (zanrepo, commit_node, delim.join (['{author}', '{bookmarks}', \ |
424 data = get_commit_data (zanrepo, commit_node, delim.join (['{node}', '{author}', '{bookmarks}', \ |
425 '{date|hgdate}'])).split (delim) |
425 '{date|hgdate}'])).split (delim) |
426 commit_author = data[0] |
426 commit_full_node = data[0] |
427 commit_bookmarks = prettify_bookmarks (data[1]) |
427 commit_author = data[1] |
428 commit_time = int (data[2].split (' ')[0]) |
428 commit_bookmarks = prettify_bookmarks (data[2]) |
|
429 commit_time = int (data[3].split (' ')[0]) |
429 commit_url = '%s/commits/%s' % (repo_url, commit_node) |
430 commit_url = '%s/commits/%s' % (repo_url, commit_node) |
430 commit_email = '' |
431 commit_email = '' |
431 |
432 |
432 # If the commit was already in the commits database, it is not a new one and we should |
433 # If the commit was already in the commits database, it is not a new one and we should |
433 # not react to it. Still add it to the db though so that the new repo name is added. |
434 # not react to it. Still add it to the db though so that the new repo name is added. |
434 g_CommitsDb.add_commit (repo=repo_name, changeset=commit_node, timestamp=commit_time) |
435 g_CommitsDb.add_commit (repo=repo_name, changeset=commit_full_node, timestamp=commit_time) |
435 if alreadyAdded: |
436 if alreadyAdded: |
436 print ('''I already know of %s - they're in %s - not announcing.''' % |
437 print ('''I already know of %s - they're in %s - not announcing.''' % |
437 (commit_node, existingrepos)) |
438 (commit_node, existingrepos)) |
438 continue |
439 continue |
439 |
440 |
535 update_zadev_topic() |
536 update_zadev_topic() |
536 except Exception as e: |
537 except Exception as e: |
537 Irc.broadcast ('Error while dealing with ZDoom upgrade number: %s' % e) |
538 Irc.broadcast ('Error while dealing with ZDoom upgrade number: %s' % e) |
538 |
539 |
539 def update_zadev_topic(): |
540 def update_zadev_topic(): |
|
541 return |
540 fraction = float (ZDoomRevNumber - ZDoomMin) / (ZDoomMax - ZDoomMin) |
542 fraction = float (ZDoomRevNumber - ZDoomMin) / (ZDoomMax - ZDoomMin) |
541 topicText = """ZDoom 2.6.1 progress: at r%d, %d revisions left (%d%% complete)""" %\ |
543 topicText = """ZDoom 2.6.1 progress: at r%d, %d revisions left (%d%% complete)""" %\ |
542 (ZDoomRevNumber, ZDoomMax - ZDoomRevNumber, round (fraction * 100)) |
544 (ZDoomRevNumber, ZDoomMax - ZDoomRevNumber, round (fraction * 100)) |
543 |
545 |
544 try: |
546 try: |