From 81fc93a87a978735130cec0011ba3fb1eec90116 Mon Sep 17 00:00:00 2001 From: kongr45gpen Date: Wed, 4 Jan 2017 00:50:12 +0200 Subject: Show force pushes even if push display is disabled Closes #15 --- config.py | 4 ++++ local/handler/GithubHandler.py | 1 + local/handler/PushHandler.py | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index 3e0f66c..86fd252 100644 --- a/config.py +++ b/config.py @@ -85,4 +85,8 @@ conf.registerChannelValue(Github, 'showPendingStatuses', registry.Boolean(True, """Whether to show a message for a pending status (e.g. a build in progress)""")) +conf.registerChannelValue(Github, 'alwaysShowForcedPushes', + registry.Boolean(True, + """Whether to always show force-pushes, even if hidePush is set to True""")) + # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: diff --git a/local/handler/GithubHandler.py b/local/handler/GithubHandler.py index ce6edd2..6a7d075 100644 --- a/local/handler/GithubHandler.py +++ b/local/handler/GithubHandler.py @@ -41,6 +41,7 @@ import IssueCommentHandler from .. import theme as themes +#TODO: Use a better name and location for this class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_POST(s): """Respond to a POST request.""" diff --git a/local/handler/PushHandler.py b/local/handler/PushHandler.py index 13052a3..903b1b6 100644 --- a/local/handler/PushHandler.py +++ b/local/handler/PushHandler.py @@ -46,7 +46,9 @@ def handle(data, theme): regularCommitCount = len(data['commits']) - mergedCommitCount isMerge = True - if configValue("hidePush",None) == False and not branched: + visible = configValue("hidePush") == False or (configValue("alwaysShowForcedPushes") == True and data['forced']) + + if visible and not branched: theme.push( branch = branch, actor = data['pusher']['name'], -- cgit v1.2.3