25 'level': 'admin', |
27 'level': 'admin', |
26 } |
28 } |
27 ] |
29 ] |
28 } |
30 } |
29 |
31 |
|
32 def plural (a): |
|
33 return '' if a == 1 else 's' |
|
34 |
30 def cmd_checkhg (bot, **rest): |
35 def cmd_checkhg (bot, **rest): |
31 HgPoll.force_poll() |
36 HgPoll.force_poll() |
32 |
37 |
33 def cmd_cset (bot, args, **rest): |
38 def cmd_cset (bot, args, replyto, **rest): |
34 repo = Repo ('zandronum-everything') |
39 repo = Repo ('zandronum-everything') |
35 data = "" |
40 data = "" |
36 node = args['key'] |
41 node = args['key'] |
37 |
42 |
38 # Possibly we're passed a date version instead. Try find the node for this. |
43 # Possibly we're passed a date version instead. Try find the node for this. |
39 try: |
44 try: |
40 datetime.strptime (args['key'], '%y%m%d-%H%M') |
45 datetime.strptime (args['key'], '%y%m%d-%H%M') |
41 make_commits_txt() |
46 HgPoll.make_commits_txt() |
42 commits_txt = open ('commits.txt', 'r') |
47 commits_txt = open ('commits.txt', 'r') |
43 |
48 |
44 for line in commits_txt: |
49 for line in commits_txt: |
45 data = line.replace ('\n', '').split (' ') |
50 data = line.replace ('\n', '').split (' ') |
46 if data[1] == args['key']: |
51 if data[1] == args['key']: |