Mon, 08 Dec 2014 23:27:43 +0200
- support bookmarks
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
1 | import hgapi |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
2 | import time |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
3 | import re |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
4 | import bt as Bt |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
5 | import irc as Irc |
86
6337540fb44b
- fixed missing import os
Teemu Piippo <crimsondusk64@gmail.com>
parents:
85
diff
changeset
|
6 | import os |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
7 | from datetime import datetime |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | from configfile import Config |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | g_needCommitsTxtRebuild = True |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | |
110 | 11 | def color_for_repo (repo_name): |
12 | if repo_name == 'zandronum': | |
13 | color = 4 | |
14 | elif repo_name == 'zandronum-stable': | |
15 | color = 2 | |
16 | elif repo_name == 'zandronum-sandbox': | |
17 | color = 7 | |
18 | elif repo_name == 'zandronum-sandbox-stable': | |
19 | color = 3 | |
20 | else: | |
21 | color = 0 | |
22 | return color | |
23 | ||
111 | 24 | def prettify_bookmarks (bookmarks): |
25 | return "\0036 [\002%s\002]" % bookmarks | |
26 | ||
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
27 | def make_commits_txt(): |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
28 | global g_needCommitsTxtRebuild |
87 | 29 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
30 | if g_needCommitsTxtRebuild == False: |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
31 | return |
87 | 32 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
33 | print 'Building commits.txt...' |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | # Update zandronum-everything |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
35 | repo = hgapi.Repo ('zandronum-everything') |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
36 | repo.hg_command ('pull', '../zandronum-sandbox') |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
37 | repo.hg_command ('pull', '../zandronum-sandbox-stable') |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
38 | data = repo.hg_command ('log', '--template', '{node} {date|hgdate}\n') |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
39 | f = open ('commits.txt', 'w') |
87 | 40 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
41 | for line in data.split ('\n'): |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
42 | if line == '': |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
43 | continue |
87 | 44 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
45 | words = line.split (' ') |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
46 | timestamp = int (words[1]) |
87 | 47 | f.write ('%s %s\n' % (words[0], datetime.utcfromtimestamp (timestamp).strftime |
48 | ('%y%m%d-%H%M'))) | |
49 | ||
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
50 | f.close() |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
51 | g_needCommitsTxtRebuild = False |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
52 | |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
53 | ' Check if a repository exists ' |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
54 | def check_repo_exists (repo_name, repo_owner): |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
55 | print 'Checking that %s exists...' % repo_name |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
56 | repo_url = 'https://bitbucket.org/%s/%s' % (repo_owner, repo_name) |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
57 | zanrepo = hgapi.Repo (repo_name) |
87 | 58 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
59 | try: |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
60 | zanrepo.hg_command ('id', '.') |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
61 | except hgapi.hgapi.HgException: |
87 | 62 | # If the repo does not exist, clone it. zandronum-everything can be spawned |
63 | # off other repos though | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
64 | if repo_name == 'zandronum-everything': |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
65 | if not os.path.exists (repo_name): |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
66 | os.makedirs (repo_name) |
87 | 67 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
68 | global g_needCommitsTxtRebuild |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
69 | g_needCommitsTxtRebuild = True |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
70 | print 'Init %s' % repo_name |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
71 | zanrepo.hg_command ('init') |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
72 | print 'Cloning zandronum-sandbox into %s' % repo_name |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
73 | zanrepo.hg_command ('pull', '../zandronum-sandbox') |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
74 | print 'Cloning zandronum-sandbox-stable into %s' % repo_name |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
75 | zanrepo.hg_command ('pull', '../zandronum-sandbox-stable') |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
76 | print 'Done' |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
77 | make_commits_txt() |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
78 | return |
87 | 79 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
80 | try: |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
81 | print 'Cloning %s...' % repo_name |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
82 | zanrepo.hg_clone (repo_url, repo_name) |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
83 | print 'Cloning done.' |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
84 | except Exception as e: |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
85 | print 'Unable to clone %s from %s: %s' % (repo_name, repo_url, str (`e`)) |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
86 | quit (1) |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
87 | |
88 | 88 | |
89 | class HgProcessError (Exception): | |
90 | def __init__ (self, value): | |
91 | self.message = value | |
92 | def __str__ (self): | |
93 | return self.message | |
94 | ||
87 | 95 | def announce_ticket_resolved (ticket_id, commit_node): |
91 | 96 | ticket_id = int (ticket_id) |
97 | ||
89 | 98 | try: |
99 | repo_name = 'zandronum-stable' | |
100 | zanrepo = hgapi.Repo (repo_name) | |
101 | zanrepo.hg_command ('log', '-r', commit_node) | |
102 | except hgapi.hgapi.HgException: | |
103 | try: | |
104 | repo_name = 'zandronum' | |
105 | zanrepo = hgapi.Repo (repo_name) | |
106 | zanrepo.hg_command ('log', '-r', commit_node) | |
107 | except hgapi.hgapi.HgException: | |
108 | raise HgProcessError ('unknown commit %s' % commit_node) | |
109 | ||
110 | repo_url = 'https://bitbucket.org/Torr_Samaho/%s' % repo_name | |
87 | 111 | |
112 | # Acquire additional data | |
113 | moredata = get_commit_data (zanrepo, commit_node, | |
114 | '{author|nonempty}\n{date(date, \'%A %d %B %Y %T\')}').split('\n') | |
115 | ||
116 | if len (moredata) != 2: | |
88 | 117 | raise HgProcessError ('malformed hg data while processing %s' % commit_node) |
87 | 118 | |
119 | commit_author = moredata[0] | |
120 | commit_date = moredata[1] | |
121 | commit_email = "" | |
90 | 122 | commit_message = zanrepo.hg_command ('log', '-r', commit_node, '--template', '{desc}') |
87 | 123 | |
124 | try: | |
125 | ticket_data = Bt.get_issue (ticket_id) | |
126 | except Exception as e: | |
88 | 127 | raise HgProcessError ("error while processing %s: %s" % (commit_node, e)) |
87 | 128 | |
129 | # Remove the email address from the author if possible | |
130 | rex = re.compile (r'^(.+) <([^>]+)>$.*') | |
131 | match = rex.match (commit_author) | |
132 | if match: | |
133 | commit_author = match.group (1) | |
134 | commit_email = match.group (2) | |
135 | ||
136 | commit_diffstat = zanrepo.hg_command ('diff', '--change', commit_node, '--stat') | |
137 | ||
138 | if len(commit_diffstat) > 0: | |
139 | # commit_diffstat = 'Changes in files:\n[code]\n' + commit_diffstat + '\n[/code]' | |
140 | commit_diffstat = 'Changes in files:\n' + bbcodify(commit_diffstat) | |
141 | else: | |
142 | commit_diffstat = 'No changes in files.' | |
143 | ||
144 | # Compare the email addresses against known developer usernames | |
145 | commit_trackeruser = Config.find_developer_by_email (commit_email) | |
146 | ||
147 | if commit_trackeruser != '': | |
148 | commit_author += ' [%s]' % commit_trackeruser | |
149 | ||
150 | message = 'Issue addressed by commit %s: [b][url=%s/commits/%s]%s[/url][/b]' \ | |
151 | % (commit_node, repo_url, commit_node, commit_message) | |
152 | message += "\nCommitted by %s on %s\n\n%s" \ | |
153 | % (commit_author, commit_date, commit_diffstat) | |
154 | ||
155 | need_update = False | |
156 | ||
157 | # If not already set, set handler | |
158 | if not 'handler' in ticket_data: | |
159 | ticket_data['handler'] = {'name': commit_trackeruser} | |
160 | need_update = True | |
161 | ||
162 | # Find out the status level of the ticket | |
163 | needs_testing_level = 70 | |
164 | ||
165 | if ticket_data['status']['id'] < needs_testing_level: | |
166 | ticket_data.status['id'] = needs_testing_level | |
167 | need_update = True | |
168 | ||
169 | # Set target version if not set | |
170 | if not 'target_version' in ticket_data: | |
171 | ticket_data['target_version'] = '1.4' if repo_name == 'zandronum-stable' else '2.0' | |
172 | need_update = True | |
173 | elif (ticket_data['target_version'] == '2.0' or ticket_data['target_version'] == '2.0-beta') \ | |
174 | and repo_name == 'zandronum-stable': | |
175 | # Target version was 2.0 but this was just committed to zandronum-stable, adjust | |
176 | ticket_data['target_version'] = '1.4' | |
177 | need_update = True | |
178 | elif ticket_data['target_version'] == '2.0-beta': | |
179 | # Fix target version from 2.0-beta to 2.0 | |
180 | ticket_data['target_version'] = '2.0' | |
181 | need_update = True | |
182 | ||
183 | # Announce on IRC | |
184 | for irc_client in Irc.all_clients: | |
185 | for channel in irc_client.channels: | |
186 | if channel.get_value ('btannounce', default=True): | |
187 | irc_client.privmsg (channel.get_value ('name'), | |
110 | 188 | "\003%d%s\003: commit\0035 %s\003 addresses issue\002\0032 %d\002" % (color_for_repo (repo_name), repo_name, commit_node, ticket_id)) |
87 | 189 | irc_client.privmsg (channel.get_value ('name'), |
190 | "Read all about it here: " + Bt.get_ticket_url (ticket_id)) | |
191 | ||
192 | if need_update: | |
193 | # We need to remove the note data, otherwise the ticket notes | |
194 | # will get unnecessary updates. WTF, MantisBT? | |
195 | ticket_data.notes = [] | |
196 | Bt.update_issue (ticket_id, ticket_data) | |
197 | ||
198 | Bt.post_note (ticket_id, message) | |
199 | ||
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
200 | def init(): |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
201 | check_repo_exists ('zandronum', 'Torr_Samaho') |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
202 | check_repo_exists ('zandronum-stable', 'Torr_Samaho') |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
203 | check_repo_exists ('zandronum-sandbox', 'crimsondusk') |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
204 | check_repo_exists ('zandronum-sandbox-stable', 'crimsondusk') |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
205 | check_repo_exists ('zandronum-everything', '') |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
206 | global repocheck_timeout |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
207 | repocheck_timeout = (time.time()) + 15 |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
208 | |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
209 | def get_commit_data (zanrepo, rev, template): |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
210 | return zanrepo.hg_command ('log', '-l', '1', '-r', rev, '--template', template) |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
211 | |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
212 | def decipher_hgapi_error (e): |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
213 | # Blah, hgapi, why must your error messages be so mangled? |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
214 | try: |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
215 | rawmsg = e.message.replace('\n', '').replace('" +','').replace('\t','') |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
216 | errmsg = re.compile (r'.*: tErr: (.*)Out:.*').match (rawmsg).group (1) |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
217 | return [True, errmsg] |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
218 | except: |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
219 | return [False, ''] |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
220 | |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
221 | def bbcodify (commit_diffstat): |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
222 | result = '' |
87 | 223 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
224 | for line in commit_diffstat.split('\n'): |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
225 | rex = re.compile (r'^(.*)\|(.*) (\+*)(-*)(.*)$') |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
226 | match = rex.match (line) |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
227 | if match: |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
228 | line = '%s|%s [color=#5F7]%s[/color][color=#F53]%s[/color]%s\n' \ |
111 | 229 | % (match.group (1), match.group (2), match.group (3), |
230 | match.group (4), match.group (5)) | |
87 | 231 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
232 | # Tracker doesn't seem to like empty color tags |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
233 | line = line.replace ('[color=#5F7][/color]', '').replace ('[color=#F53][/color]', '') |
87 | 234 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
235 | result += line |
87 | 236 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
237 | return result |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
238 | |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
239 | def poll(): |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
240 | global repocheck_timeout |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
241 | if time.time() < repocheck_timeout: |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
242 | return |
87 | 243 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
244 | for n in ['zandronum-stable', 'zandronum', 'zandronum-sandbox', 'zandronum-sandbox-stable']: |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
245 | poll_one_repo (n) |
87 | 246 | |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
247 | hgns = Config.get_node ('hg') |
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
248 | repocheck_timeout = time.time() + hgns.get_value ('checkinterval', default=15) * 60 |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
249 | |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
250 | def poll_one_repo (repo_name): |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
251 | global repocheck_timeout |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
252 | hgns = Config.get_node ('hg') |
87 | 253 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
254 | if not hgns.get_value ('track', default=True): |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
255 | return |
87 | 256 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
257 | usesandbox = repo_name == 'zandronum-sandbox' or repo_name == 'zandronum-sandbox-stable' |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
258 | repo_owner = 'Torr_Samaho' if not usesandbox else 'crimsondusk' |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
259 | zanrepo = hgapi.Repo (repo_name) |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
260 | commit_data = [] |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
261 | delimeter = '@@@@@@@@@@' |
109
87ad0c1b3405
- commit latest changes
Teemu Piippo <crimsondusk64@gmail.com>
parents:
108
diff
changeset
|
262 | # print 'Checking %s for updates' % repo_name |
87 | 263 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
264 | try: |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
265 | data = zanrepo.hg_command ('incoming', '--quiet', '--template', |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
266 | '{node|short} {desc}' + delimeter) |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
267 | except hgapi.hgapi.HgException as e: |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
268 | deciphered = decipher_hgapi_error (e) |
87 | 269 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
270 | if deciphered[0] and len(deciphered[1]) > 0: |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
271 | Irc.broadcast ("error while using hg import on %s: %s" % (repo_name, deciphered[1])) |
87 | 272 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
273 | return |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
274 | except Exception as e: |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
275 | Irc.broadcast ("%s" % `e`) |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
276 | return |
87 | 277 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
278 | for line in data.split (delimeter): |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
279 | if line == '': |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
280 | continue |
87 | 281 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
282 | rex = re.compile (r'([^ ]+) (.+)') |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
283 | match = rex.match (line) |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
284 | failed = False |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
285 | |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
286 | if not match: |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
287 | Irc.broadcast ('malformed hg data: %s' % line) |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
288 | continue |
87 | 289 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
290 | commit_node = match.group (1) |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
291 | commit_message = match.group (2) |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
292 | commit_data.append ([commit_node, commit_message]) |
87 | 293 | |
97 | 294 | process_new_commits (repo_name, commit_data) |
295 | ||
296 | def process_new_commits (repo_name, commit_data): | |
108
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
297 | if len (commit_data) == 0: |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
298 | return |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
299 | |
98
4edbdf390bd1
- fix previous commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
97
diff
changeset
|
300 | usestable = repo_name == 'zandronum-stable' |
4edbdf390bd1
- fix previous commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
97
diff
changeset
|
301 | usesandbox = repo_name == 'zandronum-sandbox' or repo_name == 'zandronum-sandbox-stable' |
4edbdf390bd1
- fix previous commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
97
diff
changeset
|
302 | repo_owner = 'Torr_Samaho' if not usesandbox else 'crimsondusk' |
4edbdf390bd1
- fix previous commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
97
diff
changeset
|
303 | repo_url = 'https://bitbucket.org/%s/%s' % (repo_owner, repo_name) |
4edbdf390bd1
- fix previous commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
97
diff
changeset
|
304 | num_commits = 0 |
4edbdf390bd1
- fix previous commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
97
diff
changeset
|
305 | zanrepo = hgapi.Repo (repo_name) |
110 | 306 | print '%d new commits on %s' % (len (commit_data), repo_name) |
87 | 307 | |
108
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
308 | # Drop commits that we already have |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
309 | i = 0 |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
310 | while i < len (commit_data): |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
311 | try: |
109
87ad0c1b3405
- commit latest changes
Teemu Piippo <crimsondusk64@gmail.com>
parents:
108
diff
changeset
|
312 | zanrepo.hg_command ('log', '-r', commit_data[i][0]) |
108
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
313 | del commit_data[i] |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
314 | except: |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
315 | i += 1 |
87 | 316 | |
108
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
317 | pull_args = []; |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
318 | |
108
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
319 | for commit in commit_data: |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
320 | pull_args.append ('-r'); |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
321 | pull_args.append (commit[0]); |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
322 | |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
323 | print 'Pulling new commits...' |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
324 | try: |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
325 | zanrepo.hg_command ('pull', *pull_args) |
87 | 326 | |
108
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
327 | # Also pull these commits to the zandronum main repository |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
328 | if usestable: |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
329 | devrepo = hgapi.Repo ('zandronum') |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
330 | devrepo.hg_command ('pull', '../zandronum-stable', *pull_args) |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
331 | # Pull everything into sandboxes too |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
332 | if not usesandbox: |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
333 | devrepo = hgapi.Repo ('zandronum-sandbox') |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
334 | devrepo.hg_command ('pull', '../%s' % repo_name, *pull_args) |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
335 | |
108
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
336 | devrepo = hgapi.Repo ('zandronum-sandbox-stable') |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
337 | devrepo.hg_command ('pull', '../%s' % repo_name, *pull_args) |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
338 | |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
339 | devrepo = hgapi.Repo ('zandronum-everything') |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
340 | devrepo.hg_command ('pull', '../%s' % repo_name, *pull_args) |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
341 | |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
342 | global g_needCommitsTxtRebuild |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
343 | g_needCommitsTxtRebuild = True |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
344 | |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
345 | except Exception as e: |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
346 | Irc.broadcast ('Warning: unable to pull: %s' % `e`) |
8cf31b4d5fcb
- we now need an explicit check against double-processing commits
Teemu Piippo <crimsondusk64@gmail.com>
parents:
101
diff
changeset
|
347 | return |
87 | 348 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
349 | for commit in commit_data: |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
350 | commit_node = commit[0] |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
351 | commit_message = commit[1] |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
352 | print 'Processing new commit %s...' % commit_node |
87 | 353 | |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
354 | try: |
111 | 355 | data = get_commit_data (zanrepo, commit_node, '{author}@@@@@@@@@@{bookmarks}').split ("@@@@@@@@@@") |
356 | commit_author = data[0] | |
357 | commit_bookmarks = prettify_bookmarks (data[1]) | |
100
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
358 | commit_url = '%s/commits/%s' % (repo_url, commit_node) |
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
359 | commit_email = '' |
87 | 360 | |
100
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
361 | # Remove the email address from the author if possible |
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
362 | rex = re.compile (r'^(.+) <([^>]+)>$.*') |
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
363 | match = rex.match (commit_author) |
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
364 | if match: |
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
365 | commit_author = match.group (1) |
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
366 | commit_email = match.group (2) |
87 | 367 | |
100
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
368 | commit_trackeruser = Config.find_developer_by_email (commit_email) |
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
369 | committer = commit_trackeruser if commit_trackeruser != '' else commit_author |
87 | 370 | |
100
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
371 | for irc_client in Irc.all_clients: |
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
372 | for channel in irc_client.channels: |
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
373 | if not usesandbox or channel.get_value ('btprivate', False): |
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
374 | irc_client.privmsg (channel.get_value ('name'), |
111 | 375 | "\003%d%s\003: new commit\0035 %s%s\003 by\0032 %s\003: %s" |
376 | % (color_for_repo (repo_name), repo_name, commit_node, commit_bookmarks, | |
377 | committer, commit_url)) | |
87 | 378 | |
100
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
379 | for line in commit_message.split ('\n'): |
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
380 | irc_client.privmsg (channel.get_value ('name'), line) |
87 | 381 | |
100
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
382 | if not usesandbox: |
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
383 | rex = re.compile (r'^.*(fixes|resolves|addresses|should fix) ([0-9]+).*$') |
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
384 | match = rex.match (commit_message) |
87 | 385 | |
100
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
386 | if match: |
2a56ccf67782
- be more liberal on posting commit messages to IRC
Teemu Piippo <crimsondusk64@gmail.com>
parents:
98
diff
changeset
|
387 | announce_ticket_resolved (match.group (2), commit_node) |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
388 | |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
389 | num_commits += 1 |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
390 | except Exception as e: |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
391 | Irc.broadcast ('Error while processing %s: %s' % (commit_node, e)) |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
392 | continue |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
393 | |
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
394 | def force_poll(): |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
72
diff
changeset
|
395 | global repocheck_timeout |
72
2266d6d73de3
- commit work done on splitting bt/hg
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
396 | repocheck_timeout = 0 |
85
302e2bec51d8
- fixed bad find_developer_by_email call
Teemu Piippo <crimsondusk64@gmail.com>
parents:
76
diff
changeset
|
397 | poll() |