#!/bin/false python ## ## Copyright (c) 2006 Jason Dillon ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## ## http://www.apache.org/licenses/LICENSE-2.0 ## ## Unless required by applicable law or agreed to in writing, software ## distributed under the License is distributed on an "AS IS" BASIS, ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## See the License for the specific language governing permissions and ## limitations under the License. ## ## ## $Id: p4spam.conf 82 2009-08-26 09:26:36Z mindwanderer $ ## # The path to the 'p4' executable. The users path will be searched. P4_CMD="/usr/bin/p4" # The port (hostname:port) of the Perforce server #P4_PORT="perforce:1666" # This is the actual command-line that will be used to execute `p4` #P4_CMDLINE=(P4_CMD, '-p', P4_PORT, '-u', P4_USER) ## ## NOTE: If a password is required, the P4_CMDLINE should be updated to add -P ## options ## # P4_CMDLINE=(P4_CMD, '-p', P4_PORT) # The name of the counter to track the last change P4Spam has processed LAST_CHANGELIST_COUNTER = 'p4spam.lastchange' ## ## Daemon Options ## # Set to True if you want P4Spam to loop as a daemon process REPEAT = False # The time in sections to sleep beteen iterations (when repeating) SLEEPTIME = 60 ## ## Email Options ## # The SMTP server (hostname:port) SMTP_HOST = "localhost:25" # True to enable sending email (NOTE: You must change this) SPAM_ENABLED = False # True to enable sending email to users (else just the admins will get email) SPAM_USERS = True # Set to the p4 username of an admin which will receive emails bcc'd ADMIN_BCC_ADDR = None # The format used for the subject line, needs two %s one for the change #, another for the comment # SUBJECT_FORMAT = '[P4] #%s - %s' # Set to 'first' or 'strip' (default is strip) # SUBJECT_NEW_LINES = 'first' # How the email address from change description will be formatted. The data # is taken from the user information assositated witht the changelist. # supported named variables are: fullname, user and email. # FROM_ADDR_FORMAT = '"%(fullname)s (Perforce)" <%(email)s>' ## ## Resource Limits ## # At most proccess these many changes in a batch. When run by cron there is only # one batch, when run as a daemon, a batch is per loop iteration MAX_BATCH = 100 # If a diff contains more than n lines, truncate MAX_DIFF_LINES = 100 # If a single line of a diff is longer than n chars, truncate MAX_DIFF_LINE_LENGTH = 500 # If the file listing is longer than this, truncate MAX_FILE_LIST = 1000 # If there are this many files involved in the diff, truncate MAX_DIFF_FILES = 100 # If the subject is longer than n chars, truncate MAX_SUBJECT_LINE_LENGTH = 200 DISABLE_DIFF_FOR_FILETYPE = "binary" ## ## HTML Generation ## # The basic style that makes the email look nice and sexy HTML_STYLE = ''' #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } table { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; font-family : arial,helvetica,sans-serif; font-size : 10pt; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch a { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch a { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } ''' # The format to generate the change list URL CHANGE_LIST_URL = "http://perforce.mycompany.com/changelist.php?change=%s" # The format to generate the file history URL FILE_HISTORY_URL = "http://perforce.mycompany.com/history.php?path=%s" # The format to generate the JIRA linker URL JIRA_BROWSE_URL = "https://issues.mycompany.com/browse/%s" ## ## Custom HTML ## # Set to a string to include into the <head> portion of the email USER_HEADER = None # Set to a string to include into the <body> portion of the email before content # related to the change is added USER_BODY_HEADER = None # Set to a string to include into the <body> portion of the email after content # related to the change is added USER_BODY_FOOTER = None ## ## Subscriptions ## # Set to True to enable custom regex subscriptions SUBSCRIPTIONS_ENABLED = False # Set to True to enable standard user reviews USER_REVIEWS_ENABLED = True # "<view>": ("<email>","<email>"), # Definition of custom regex subscriptions. This is a map of regex pattern to # a list of email addresses: # # "<pattern>": ("<email>","<email>"), # SUBSCRIPTIONS = { # "//depot/myproject/.*": ("myproject@mycompany.com"), }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 7833 | Matthew Janulewicz | P4Spam now obeys 'p4 protects' and will not expose code diffs to subscribers that do not have the proper p4 permissions to view that diff. | ||
#1 | 7731 | Matthew Janulewicz |
Adding P4Spam 1.1 code from http://p4spam.sourceforge.net/wiki/Main_Page "P4Spam is a Perforce change review daemon which spits out sexy HTML-styled notification emails." |