| OLD | NEW |
| 1 # This file is part of Buildbot. Buildbot is free software: you can | 1 # This file is part of Buildbot. Buildbot is free software: you can |
| 2 # redistribute it and/or modify it under the terms of the GNU General Public | 2 # redistribute it and/or modify it under the terms of the GNU General Public |
| 3 # License as published by the Free Software Foundation, version 2. | 3 # License as published by the Free Software Foundation, version 2. |
| 4 # | 4 # |
| 5 # This program is distributed in the hope that it will be useful, but WITHOUT | 5 # This program is distributed in the hope that it will be useful, but WITHOUT |
| 6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 8 # details. | 8 # details. |
| 9 # | 9 # |
| 10 # You should have received a copy of the GNU General Public License along with | 10 # You should have received a copy of the GNU General Public License along with |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 protocols) are expected to provide the lower-level send/receive methods. | 82 protocols) are expected to provide the lower-level send/receive methods. |
| 83 | 83 |
| 84 There will be one instance of me for each user who interacts personally | 84 There will be one instance of me for each user who interacts personally |
| 85 with the buildbot. There will be an additional instance for each | 85 with the buildbot. There will be an additional instance for each |
| 86 'broadcast contact' (chat rooms, IRC channels as a whole). | 86 'broadcast contact' (chat rooms, IRC channels as a whole). |
| 87 """ | 87 """ |
| 88 | 88 |
| 89 def __init__(self, channel): | 89 def __init__(self, channel): |
| 90 #StatusReceiver.__init__(self) doesn't exist | 90 #StatusReceiver.__init__(self) doesn't exist |
| 91 self.channel = channel | 91 self.channel = channel |
| 92 self.master = channel.master |
| 92 self.notify_events = {} | 93 self.notify_events = {} |
| 93 self.subscribed = 0 | 94 self.subscribed = 0 |
| 94 self.muted = False | 95 self.muted = False |
| 95 self.reported_builds = [] # tuples (when, buildername, buildnum) | 96 self.reported_builds = [] # tuples (when, buildername, buildnum) |
| 96 self.add_notification_events(channel.notify_events) | 97 self.add_notification_events(channel.notify_events) |
| 97 | 98 |
| 98 silly = { | 99 silly = { |
| 99 "What happen ?": "Somebody set up us the bomb.", | 100 "What happen ?": "Somebody set up us the bomb.", |
| 100 "It's You !!": ["How are you gentlemen !!", | 101 "It's You !!": ["How are you gentlemen !!", |
| 101 "All your base are belong to us.", | 102 "All your base are belong to us.", |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 | 445 |
| 445 which = opts['builder'] | 446 which = opts['builder'] |
| 446 branch = opts['branch'] | 447 branch = opts['branch'] |
| 447 revision = opts['revision'] | 448 revision = opts['revision'] |
| 448 reason = opts['reason'] | 449 reason = opts['reason'] |
| 449 | 450 |
| 450 if which is None: | 451 if which is None: |
| 451 raise UsageError("you must provide a Builder, " + errReply) | 452 raise UsageError("you must provide a Builder, " + errReply) |
| 452 | 453 |
| 453 # keep weird stuff out of the branch and revision strings. | 454 # keep weird stuff out of the branch and revision strings. |
| 454 # TODO: centralize this somewhere. | 455 branch_validate = self.master.config.validation['branch'] |
| 455 if branch and not re.match(r'^[\w\.\-\/]*$', branch): | 456 revision_validate = self.master.config.validation['revision'] |
| 457 if branch and not branch_validate.match(branch): |
| 456 log.msg("bad branch '%s'" % branch) | 458 log.msg("bad branch '%s'" % branch) |
| 457 self.send("sorry, bad branch '%s'" % branch) | 459 self.send("sorry, bad branch '%s'" % branch) |
| 458 return | 460 return |
| 459 if revision and not re.match(r'^[\w\.\-\/]*$', revision): | 461 if revision and not revision_validate.match(revision): |
| 460 log.msg("bad revision '%s'" % revision) | 462 log.msg("bad revision '%s'" % revision) |
| 461 self.send("sorry, bad revision '%s'" % revision) | 463 self.send("sorry, bad revision '%s'" % revision) |
| 462 return | 464 return |
| 463 | 465 |
| 464 bc = self.getControl(which) | 466 bc = self.getControl(which) |
| 465 | 467 |
| 466 reason = "forced: by %s: %s" % (self.describeUser(who), reason) | 468 reason = "forced: by %s: %s" % (self.describeUser(who), reason) |
| 467 ss = SourceStamp(branch=branch, revision=revision) | 469 ss = SourceStamp(branch=branch, revision=revision) |
| 468 d = bc.submitBuildRequest(ss, reason) | 470 d = bc.submitBuildRequest(ss, reason) |
| 469 def subscribe(buildreq): | 471 def subscribe(buildreq): |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 | 967 |
| 966 | 968 |
| 967 ## buildbot: list builders | 969 ## buildbot: list builders |
| 968 # buildbot: watch quick | 970 # buildbot: watch quick |
| 969 # print notification when current build in 'quick' finishes | 971 # print notification when current build in 'quick' finishes |
| 970 ## buildbot: status | 972 ## buildbot: status |
| 971 ## buildbot: status full-2.3 | 973 ## buildbot: status full-2.3 |
| 972 ## building, not, % complete, ETA | 974 ## building, not, % complete, ETA |
| 973 ## buildbot: force build full-2.3 "reason" | 975 ## buildbot: force build full-2.3 "reason" |
| 974 | 976 |
| OLD | NEW |