diff -r 44d9aea72947 -r cdafc1a0544e hgpoll.py --- a/hgpoll.py Mon Dec 08 23:27:43 2014 +0200 +++ b/hgpoll.py Wed Dec 31 10:27:57 2014 -0500 @@ -17,6 +17,8 @@ color = 7 elif repo_name == 'zandronum-sandbox-stable': color = 3 + elif repo_name == 'zfc9000': + color = 6 else: color = 0 return color @@ -44,8 +46,7 @@ words = line.split (' ') timestamp = int (words[1]) - f.write ('%s %s\n' % (words[0], datetime.utcfromtimestamp (timestamp).strftime -('%y%m%d-%H%M'))) + f.write ('%s %s\n' % (words[0], datetime.utcfromtimestamp (timestamp).strftime ('%y%m%d-%H%M'))) f.close() g_needCommitsTxtRebuild = False @@ -203,6 +204,7 @@ check_repo_exists ('zandronum-sandbox', 'crimsondusk') check_repo_exists ('zandronum-sandbox-stable', 'crimsondusk') check_repo_exists ('zandronum-everything', '') + check_repo_exists ('zfc9000', 'crimsondusk') global repocheck_timeout repocheck_timeout = (time.time()) + 15 @@ -241,7 +243,7 @@ if time.time() < repocheck_timeout: return - for n in ['zandronum-stable', 'zandronum', 'zandronum-sandbox', 'zandronum-sandbox-stable']: + for n in ['zandronum-stable', 'zandronum', 'zandronum-sandbox', 'zandronum-sandbox-stable', 'zfc9000']: poll_one_repo (n) hgns = Config.get_node ('hg') @@ -255,7 +257,7 @@ return usesandbox = repo_name == 'zandronum-sandbox' or repo_name == 'zandronum-sandbox-stable' - repo_owner = 'Torr_Samaho' if not usesandbox else 'crimsondusk' + repo_owner = 'Torr_Samaho' if (not usesandbox and repo_name != 'zfc9000') else 'crimsondusk' zanrepo = hgapi.Repo (repo_name) commit_data = [] delimeter = '@@@@@@@@@@' @@ -299,7 +301,7 @@ usestable = repo_name == 'zandronum-stable' usesandbox = repo_name == 'zandronum-sandbox' or repo_name == 'zandronum-sandbox-stable' - repo_owner = 'Torr_Samaho' if not usesandbox else 'crimsondusk' + repo_owner = 'Torr_Samaho' if (not usesandbox and repo_name != 'zfc9000') else 'crimsondusk' repo_url = 'https://bitbucket.org/%s/%s' % (repo_owner, repo_name) num_commits = 0 zanrepo = hgapi.Repo (repo_name) @@ -324,23 +326,24 @@ try: zanrepo.hg_command ('pull', *pull_args) - # Also pull these commits to the zandronum main repository - if usestable: - devrepo = hgapi.Repo ('zandronum') - devrepo.hg_command ('pull', '../zandronum-stable', *pull_args) - # Pull everything into sandboxes too - if not usesandbox: - devrepo = hgapi.Repo ('zandronum-sandbox') + if repo_name[0:9] == 'zandronum': + # Also pull these commits to the zandronum main repository + if usestable: + devrepo = hgapi.Repo ('zandronum') + devrepo.hg_command ('pull', '../zandronum-stable', *pull_args) + # Pull everything into sandboxes too + if not usesandbox: + devrepo = hgapi.Repo ('zandronum-sandbox') + devrepo.hg_command ('pull', '../%s' % repo_name, *pull_args) + + devrepo = hgapi.Repo ('zandronum-sandbox-stable') + devrepo.hg_command ('pull', '../%s' % repo_name, *pull_args) + + devrepo = hgapi.Repo ('zandronum-everything') devrepo.hg_command ('pull', '../%s' % repo_name, *pull_args) - - devrepo = hgapi.Repo ('zandronum-sandbox-stable') - devrepo.hg_command ('pull', '../%s' % repo_name, *pull_args) - - devrepo = hgapi.Repo ('zandronum-everything') - devrepo.hg_command ('pull', '../%s' % repo_name, *pull_args) - - global g_needCommitsTxtRebuild - g_needCommitsTxtRebuild = True + + global g_needCommitsTxtRebuild + g_needCommitsTxtRebuild = True except Exception as e: Irc.broadcast ('Warning: unable to pull: %s' % `e`) @@ -370,7 +373,10 @@ for irc_client in Irc.all_clients: for channel in irc_client.channels: - if not usesandbox or channel.get_value ('btprivate', False): + if not channel.get_value ('btannounce', False): + continue + + if (not usesandbox and repo_name != 'zfc9000') or channel.get_value ('btprivate', False): irc_client.privmsg (channel.get_value ('name'), "\003%d%s\003: new commit\0035 %s%s\003 by\0032 %s\003: %s" % (color_for_repo (repo_name), repo_name, commit_node, commit_bookmarks,