# HG changeset patch # User Marcin Kuzminski # Date 2013-03-21 20:03:22 # Node ID 58dcef7eef032bba70f1d3221f9223893eede220 # Parent 4358b1b9307db10412c203c3970c5dee5e728672 Implemented show_id function that is a configurable way to display sha hashes in the changelog. diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -25,69 +25,88 @@ pdebug = false #smtp_port = #smtp_use_tls = false #smtp_use_ssl = true -# Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.) +## Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.) #smtp_auth = [server:main] ## PASTE -##nr of threads to spawn +## nr of threads to spawn #threadpool_workers = 5 -##max request before thread respawn +## max request before thread respawn #threadpool_max_requests = 10 -##option to use threads of process +## option to use threads of process #use_threadpool = true #use = egg:Paste#http -#WAITRESS +## WAITRESS threads = 5 -#100GB +## 100GB max_request_body_size = 107374182400 use = egg:waitress#main host = 0.0.0.0 port = 5000 -[filter:proxy-prefix] -# prefix middleware for rc -use = egg:PasteDeploy#prefix -prefix = / +## prefix middleware for rc +#[filter:proxy-prefix] +#use = egg:PasteDeploy#prefix +#prefix = / [app:main] use = egg:rhodecode +## enable proxy prefix middleware #filter-with = proxy-prefix + full_stack = true static_files = true -# Optional Languages -# en, fr, ja, pt_BR, zh_CN, zh_TW, pl +## Optional Languages +## en, fr, ja, pt_BR, zh_CN, zh_TW, pl lang = en cache_dir = %(here)s/data index_dir = %(here)s/data/index -# set this path to use archive download cache -#archive_cache_dir = /tmp/rhodecode_tarballcache -app_instance_uuid = rc-develop + +## uncomment and set this path to use archive download cache +#archive_cache_dir = /tmp/tarballcache + +## change this to unique ID for security +app_instance_uuid = rc-production + +## cut off limit for large diffs (size in bytes) cut_off_limit = 256000 -vcs_full_cache = True -# force https in RhodeCode, fixes https redirects, assumes it's always https + +## use cache version of scm repo everywhere +vcs_full_cache = true + +## force https in RhodeCode, fixes https redirects, assumes it's always https force_https = false -# use Strict-Transport-Security headers + +## use Strict-Transport-Security headers use_htsts = false + +## number of commits stats will parse on each iteration commit_parse_limit = 25 -# number of items displayed in lightweight dashboard before paginating + +## number of items displayed in lightweight dashboard before paginating is shown dashboard_items = 100 + +## use gravatar service to display avatars use_gravatar = true -# path to git executable +## path to git executable git_path = git ## RSS feed options - rss_cut_off_limit = 256000 rss_items_per_page = 10 rss_include_diff = false +## show hash options for changelog +sha_len = 12 +sha_rev = true + ## alternative_gravatar_url allows you to use your own avatar server application ## the following parts of the URL will be replaced @@ -99,8 +118,11 @@ rss_include_diff = false #alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size} #alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size} + +## container auth options container_auth_enabled = false proxypass_auth_enabled = false + ## default encoding used to convert from and to unicode ## can be also a comma seperated list of encoding in case of mixed encodings default_encoding = utf8 @@ -185,7 +207,7 @@ celeryd.concurrency = 2 celeryd.log.level = debug celeryd.max.tasks.per.child = 1 -#tasks will never be sent to the queue, but executed locally instead. +## tasks will never be sent to the queue, but executed locally instead. celery.always.eager = false #################################### @@ -241,18 +263,19 @@ beaker.cache.sql_cache_long.key_length = beaker.session.key = rhodecode -## secure cookie requires AES python libraries ## -#beaker.session.encrypt_key = g654dcno0-9873jhgfreyu -#beaker.session.validate_key = 9712sds2212c--zxc123 +## secure cookie requires AES python libraries +#beaker.session.encrypt_key = +#beaker.session.validate_key = + ## sets session as invalid if it haven't been accessed for given amount of time beaker.session.timeout = 2592000 beaker.session.httponly = true #beaker.session.cookie_path = / -## uncomment for https secure cookie ## +## uncomment for https secure cookie beaker.session.secure = false -## auto save the session to not to use .save() ## +## auto save the session to not to use .save() beaker.session.auto = False ## default cookie expiration time in seconds `true` expire at browser close ## @@ -267,57 +290,57 @@ beaker.session.auto = False ### [errormator] ### #################### -# Errormator is tailored to work with RhodeCode, see -# http://errormator.com for details how to obtain an account -# you must install python package `errormator_client` to make it work +## Errormator is tailored to work with RhodeCode, see +## http://errormator.com for details how to obtain an account +## you must install python package `errormator_client` to make it work -# errormator enabled -errormator = true +## errormator enabled +errormator = false errormator.server_url = https://api.errormator.com errormator.api_key = YOUR_API_KEY -# TWEAK AMOUNT OF INFO SENT HERE +## TWEAK AMOUNT OF INFO SENT HERE -# enables 404 error logging (default False) +## enables 404 error logging (default False) errormator.report_404 = false -# time in seconds after request is considered being slow (default 1) +## time in seconds after request is considered being slow (default 1) errormator.slow_request_time = 1 -# record slow requests in application -# (needs to be enabled for slow datastore recording and time tracking) +## record slow requests in application +## (needs to be enabled for slow datastore recording and time tracking) errormator.slow_requests = true -# enable hooking to application loggers +## enable hooking to application loggers # errormator.logging = true -# minimum log level for log capture +## minimum log level for log capture # errormator.logging.level = WARNING -# send logs only from erroneous/slow requests -# (saves API quota for intensive logging) +## send logs only from erroneous/slow requests +## (saves API quota for intensive logging) errormator.logging_on_error = false -# list of additonal keywords that should be grabbed from environ object -# can be string with comma separated list of words in lowercase -# (by default client will always send following info: -# 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that -# start with HTTP* this list be extended with additional keywords here +## list of additonal keywords that should be grabbed from environ object +## can be string with comma separated list of words in lowercase +## (by default client will always send following info: +## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that +## start with HTTP* this list be extended with additional keywords here errormator.environ_keys_whitelist = -# list of keywords that should be blanked from request object -# can be string with comma separated list of words in lowercase -# (by default client will always blank keys that contain following words -# 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' -# this list be extended with additional keywords set here +## list of keywords that should be blanked from request object +## can be string with comma separated list of words in lowercase +## (by default client will always blank keys that contain following words +## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' +## this list be extended with additional keywords set here errormator.request_keys_blacklist = -# list of namespaces that should be ignores when gathering log entries -# can be string with comma separated list of namespaces -# (by default the client ignores own entries: errormator_client.client) +## list of namespaces that should be ignores when gathering log entries +## can be string with comma separated list of namespaces +## (by default the client ignores own entries: errormator_client.client) errormator.log_namespace_blacklist = @@ -325,8 +348,8 @@ errormator.log_namespace_blacklist = ### [sentry] ### ################ -# sentry is a alternative open source error aggregator -# you must install python packages `sentry` and `raven` to enable +## sentry is a alternative open source error aggregator +## you must install python packages `sentry` and `raven` to enable sentry.dsn = YOUR_DNS sentry.servers = @@ -386,7 +409,7 @@ handlers = console level = DEBUG handlers = qualname = routes.middleware -# "level = DEBUG" logs the route matched and routing variables. +## "level = DEBUG" logs the route matched and routing variables. propagate = 1 [logger_beaker] diff --git a/production.ini b/production.ini --- a/production.ini +++ b/production.ini @@ -25,69 +25,88 @@ pdebug = false #smtp_port = #smtp_use_tls = false #smtp_use_ssl = true -# Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.) +## Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.) #smtp_auth = [server:main] ## PASTE -##nr of threads to spawn +## nr of threads to spawn #threadpool_workers = 5 -##max request before thread respawn +## max request before thread respawn #threadpool_max_requests = 10 -##option to use threads of process +## option to use threads of process #use_threadpool = true #use = egg:Paste#http -#WAITRESS +## WAITRESS threads = 5 -#100GB +## 100GB max_request_body_size = 107374182400 use = egg:waitress#main host = 127.0.0.1 port = 8001 -[filter:proxy-prefix] -# prefix middleware for rc -use = egg:PasteDeploy#prefix -prefix = / +## prefix middleware for rc +#[filter:proxy-prefix] +#use = egg:PasteDeploy#prefix +#prefix = / [app:main] use = egg:rhodecode +## enable proxy prefix middleware #filter-with = proxy-prefix + full_stack = true static_files = true -# Optional Languages -# en, fr, ja, pt_BR, zh_CN, zh_TW, pl +## Optional Languages +## en, fr, ja, pt_BR, zh_CN, zh_TW, pl lang = en cache_dir = %(here)s/data index_dir = %(here)s/data/index -# set this path to use archive download cache -#archive_cache_dir = /tmp/rhodecode_tarballcache + +## uncomment and set this path to use archive download cache +#archive_cache_dir = /tmp/tarballcache + +## change this to unique ID for security app_instance_uuid = rc-production + +## cut off limit for large diffs (size in bytes) cut_off_limit = 256000 -vcs_full_cache = True -# force https in RhodeCode, fixes https redirects, assumes it's always https + +## use cache version of scm repo everywhere +vcs_full_cache = true + +## force https in RhodeCode, fixes https redirects, assumes it's always https force_https = false -# use Strict-Transport-Security headers + +## use Strict-Transport-Security headers use_htsts = false -commit_parse_limit = 50 -# number of items displayed in lightweight dashboard before paginating + +## number of commits stats will parse on each iteration +commit_parse_limit = 25 + +## number of items displayed in lightweight dashboard before paginating is shown dashboard_items = 100 + +## use gravatar service to display avatars use_gravatar = true -# path to git executable +## path to git executable git_path = git ## RSS feed options - rss_cut_off_limit = 256000 rss_items_per_page = 10 rss_include_diff = false +## show hash options for changelog +sha_len = 12 +sha_rev = true + ## alternative_gravatar_url allows you to use your own avatar server application ## the following parts of the URL will be replaced @@ -99,8 +118,11 @@ rss_include_diff = false #alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size} #alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size} + +## container auth options container_auth_enabled = false proxypass_auth_enabled = false + ## default encoding used to convert from and to unicode ## can be also a comma seperated list of encoding in case of mixed encodings default_encoding = utf8 @@ -185,7 +207,7 @@ celeryd.concurrency = 2 celeryd.log.level = debug celeryd.max.tasks.per.child = 1 -#tasks will never be sent to the queue, but executed locally instead. +## tasks will never be sent to the queue, but executed locally instead. celery.always.eager = false #################################### @@ -241,18 +263,19 @@ beaker.cache.sql_cache_long.key_length = beaker.session.key = rhodecode -## secure cookie requires AES python libraries ## -#beaker.session.encrypt_key = g654dcno0-9873jhgfreyu -#beaker.session.validate_key = 9712sds2212c--zxc123 +## secure cookie requires AES python libraries +#beaker.session.encrypt_key = +#beaker.session.validate_key = + ## sets session as invalid if it haven't been accessed for given amount of time beaker.session.timeout = 2592000 beaker.session.httponly = true #beaker.session.cookie_path = / -## uncomment for https secure cookie ## +## uncomment for https secure cookie beaker.session.secure = false -## auto save the session to not to use .save() ## +## auto save the session to not to use .save() beaker.session.auto = False ## default cookie expiration time in seconds `true` expire at browser close ## @@ -267,57 +290,57 @@ beaker.session.auto = False ### [errormator] ### #################### -# Errormator is tailored to work with RhodeCode, see -# http://errormator.com for details how to obtain an account -# you must install python package `errormator_client` to make it work +## Errormator is tailored to work with RhodeCode, see +## http://errormator.com for details how to obtain an account +## you must install python package `errormator_client` to make it work -# errormator enabled -errormator = true +## errormator enabled +errormator = false errormator.server_url = https://api.errormator.com errormator.api_key = YOUR_API_KEY -# TWEAK AMOUNT OF INFO SENT HERE +## TWEAK AMOUNT OF INFO SENT HERE -# enables 404 error logging (default False) +## enables 404 error logging (default False) errormator.report_404 = false -# time in seconds after request is considered being slow (default 1) +## time in seconds after request is considered being slow (default 1) errormator.slow_request_time = 1 -# record slow requests in application -# (needs to be enabled for slow datastore recording and time tracking) +## record slow requests in application +## (needs to be enabled for slow datastore recording and time tracking) errormator.slow_requests = true -# enable hooking to application loggers +## enable hooking to application loggers # errormator.logging = true -# minimum log level for log capture +## minimum log level for log capture # errormator.logging.level = WARNING -# send logs only from erroneous/slow requests -# (saves API quota for intensive logging) +## send logs only from erroneous/slow requests +## (saves API quota for intensive logging) errormator.logging_on_error = false -# list of additonal keywords that should be grabbed from environ object -# can be string with comma separated list of words in lowercase -# (by default client will always send following info: -# 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that -# start with HTTP* this list be extended with additional keywords here +## list of additonal keywords that should be grabbed from environ object +## can be string with comma separated list of words in lowercase +## (by default client will always send following info: +## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that +## start with HTTP* this list be extended with additional keywords here errormator.environ_keys_whitelist = -# list of keywords that should be blanked from request object -# can be string with comma separated list of words in lowercase -# (by default client will always blank keys that contain following words -# 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' -# this list be extended with additional keywords set here +## list of keywords that should be blanked from request object +## can be string with comma separated list of words in lowercase +## (by default client will always blank keys that contain following words +## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' +## this list be extended with additional keywords set here errormator.request_keys_blacklist = -# list of namespaces that should be ignores when gathering log entries -# can be string with comma separated list of namespaces -# (by default the client ignores own entries: errormator_client.client) +## list of namespaces that should be ignores when gathering log entries +## can be string with comma separated list of namespaces +## (by default the client ignores own entries: errormator_client.client) errormator.log_namespace_blacklist = @@ -325,8 +348,8 @@ errormator.log_namespace_blacklist = ### [sentry] ### ################ -# sentry is a alternative open source error aggregator -# you must install python packages `sentry` and `raven` to enable +## sentry is a alternative open source error aggregator +## you must install python packages `sentry` and `raven` to enable sentry.dsn = YOUR_DNS sentry.servers = @@ -386,7 +409,7 @@ handlers = console level = DEBUG handlers = qualname = routes.middleware -# "level = DEBUG" logs the route matched and routing variables. +## "level = DEBUG" logs the route matched and routing variables. propagate = 1 [logger_beaker] diff --git a/rhodecode/config/deployment.ini_tmpl b/rhodecode/config/deployment.ini_tmpl --- a/rhodecode/config/deployment.ini_tmpl +++ b/rhodecode/config/deployment.ini_tmpl @@ -25,69 +25,88 @@ pdebug = false #smtp_port = #smtp_use_tls = false #smtp_use_ssl = true -# Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.) +## Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.) #smtp_auth = [server:main] ## PASTE -##nr of threads to spawn +## nr of threads to spawn #threadpool_workers = 5 -##max request before thread respawn +## max request before thread respawn #threadpool_max_requests = 10 -##option to use threads of process +## option to use threads of process #use_threadpool = true #use = egg:Paste#http -#WAITRESS +## WAITRESS threads = 5 -#100GB +## 100GB max_request_body_size = 107374182400 use = egg:waitress#main host = 127.0.0.1 port = 5000 -[filter:proxy-prefix] -# prefix middleware for rc -use = egg:PasteDeploy#prefix -prefix = / +## prefix middleware for rc +#[filter:proxy-prefix] +#use = egg:PasteDeploy#prefix +#prefix = / [app:main] use = egg:rhodecode +## enable proxy prefix middleware #filter-with = proxy-prefix + full_stack = true static_files = true -# Optional Languages -# en, fr, ja, pt_BR, zh_CN, zh_TW, pl +## Optional Languages +## en, fr, ja, pt_BR, zh_CN, zh_TW, pl lang = en cache_dir = %(here)s/data index_dir = %(here)s/data/index -# set this path to use archive download cache -#archive_cache_dir = /tmp/rhodecode_tarballcache + +## uncomment and set this path to use archive download cache +#archive_cache_dir = /tmp/tarballcache + +## change this to unique ID for security app_instance_uuid = ${app_instance_uuid} + +## cut off limit for large diffs (size in bytes) cut_off_limit = 256000 -vcs_full_cache = True -# force https in RhodeCode, fixes https redirects, assumes it's always https + +## use cache version of scm repo everywhere +vcs_full_cache = true + +## force https in RhodeCode, fixes https redirects, assumes it's always https force_https = false -# use Strict-Transport-Security headers + +## use Strict-Transport-Security headers use_htsts = false -commit_parse_limit = 50 -# number of items displayed in lightweight dashboard before paginating + +## number of commits stats will parse on each iteration +commit_parse_limit = 25 + +## number of items displayed in lightweight dashboard before paginating is shown dashboard_items = 100 + +## use gravatar service to display avatars use_gravatar = true -# path to git executable +## path to git executable git_path = git ## RSS feed options - rss_cut_off_limit = 256000 rss_items_per_page = 10 rss_include_diff = false +## show hash options for changelog +sha_len = 12 +sha_rev = true + ## alternative_gravatar_url allows you to use your own avatar server application ## the following parts of the URL will be replaced @@ -99,8 +118,11 @@ rss_include_diff = false #alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size} #alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size} + +## container auth options container_auth_enabled = false proxypass_auth_enabled = false + ## default encoding used to convert from and to unicode ## can be also a comma seperated list of encoding in case of mixed encodings default_encoding = utf8 @@ -185,7 +207,7 @@ celeryd.concurrency = 2 celeryd.log.level = debug celeryd.max.tasks.per.child = 1 -#tasks will never be sent to the queue, but executed locally instead. +## tasks will never be sent to the queue, but executed locally instead. celery.always.eager = false #################################### @@ -241,18 +263,19 @@ beaker.cache.sql_cache_long.key_length = beaker.session.key = rhodecode -## secure cookie requires AES python libraries ## -#beaker.session.encrypt_key = g654dcno0-9873jhgfreyu -#beaker.session.validate_key = 9712sds2212c--zxc123 +## secure cookie requires AES python libraries +#beaker.session.encrypt_key = +#beaker.session.validate_key = + ## sets session as invalid if it haven't been accessed for given amount of time beaker.session.timeout = 2592000 beaker.session.httponly = true #beaker.session.cookie_path = / -## uncomment for https secure cookie ## +## uncomment for https secure cookie beaker.session.secure = false -## auto save the session to not to use .save() ## +## auto save the session to not to use .save() beaker.session.auto = False ## default cookie expiration time in seconds `true` expire at browser close ## @@ -267,57 +290,57 @@ beaker.session.auto = False ### [errormator] ### #################### -# Errormator is tailored to work with RhodeCode, see -# http://errormator.com for details how to obtain an account -# you must install python package `errormator_client` to make it work +## Errormator is tailored to work with RhodeCode, see +## http://errormator.com for details how to obtain an account +## you must install python package `errormator_client` to make it work -# errormator enabled -errormator = true +## errormator enabled +errormator = false errormator.server_url = https://api.errormator.com errormator.api_key = YOUR_API_KEY -# TWEAK AMOUNT OF INFO SENT HERE +## TWEAK AMOUNT OF INFO SENT HERE -# enables 404 error logging (default False) +## enables 404 error logging (default False) errormator.report_404 = false -# time in seconds after request is considered being slow (default 1) +## time in seconds after request is considered being slow (default 1) errormator.slow_request_time = 1 -# record slow requests in application -# (needs to be enabled for slow datastore recording and time tracking) +## record slow requests in application +## (needs to be enabled for slow datastore recording and time tracking) errormator.slow_requests = true -# enable hooking to application loggers +## enable hooking to application loggers # errormator.logging = true -# minimum log level for log capture +## minimum log level for log capture # errormator.logging.level = WARNING -# send logs only from erroneous/slow requests -# (saves API quota for intensive logging) +## send logs only from erroneous/slow requests +## (saves API quota for intensive logging) errormator.logging_on_error = false -# list of additonal keywords that should be grabbed from environ object -# can be string with comma separated list of words in lowercase -# (by default client will always send following info: -# 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that -# start with HTTP* this list be extended with additional keywords here +## list of additonal keywords that should be grabbed from environ object +## can be string with comma separated list of words in lowercase +## (by default client will always send following info: +## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that +## start with HTTP* this list be extended with additional keywords here errormator.environ_keys_whitelist = -# list of keywords that should be blanked from request object -# can be string with comma separated list of words in lowercase -# (by default client will always blank keys that contain following words -# 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' -# this list be extended with additional keywords set here +## list of keywords that should be blanked from request object +## can be string with comma separated list of words in lowercase +## (by default client will always blank keys that contain following words +## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' +## this list be extended with additional keywords set here errormator.request_keys_blacklist = -# list of namespaces that should be ignores when gathering log entries -# can be string with comma separated list of namespaces -# (by default the client ignores own entries: errormator_client.client) +## list of namespaces that should be ignores when gathering log entries +## can be string with comma separated list of namespaces +## (by default the client ignores own entries: errormator_client.client) errormator.log_namespace_blacklist = @@ -325,8 +348,8 @@ errormator.log_namespace_blacklist = ### [sentry] ### ################ -# sentry is a alternative open source error aggregator -# you must install python packages `sentry` and `raven` to enable +## sentry is a alternative open source error aggregator +## you must install python packages `sentry` and `raven` to enable sentry.dsn = YOUR_DNS sentry.servers = @@ -396,7 +419,7 @@ handlers = console level = DEBUG handlers = qualname = routes.middleware -# "level = DEBUG" logs the route matched and routing variables. +## "level = DEBUG" logs the route matched and routing variables. propagate = 1 [logger_beaker] diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -43,7 +43,8 @@ from webhelpers.html.tags import _set_in from rhodecode.lib.annotate import annotate_highlight from rhodecode.lib.utils import repo_name_slug, get_custom_lexer from rhodecode.lib.utils2 import str2bool, safe_unicode, safe_str, \ - get_changeset_safe, datetime_to_time, time_to_datetime, AttributeDict + get_changeset_safe, datetime_to_time, time_to_datetime, AttributeDict,\ + safe_int from rhodecode.lib.markup_renderer import MarkupRenderer from rhodecode.lib.vcs.exceptions import ChangesetDoesNotExistError from rhodecode.lib.vcs.backends.base import BaseChangeset, EmptyChangeset @@ -363,13 +364,31 @@ from rhodecode.lib.vcs.utils import auth from rhodecode.lib.utils2 import credentials_filter, age as _age from rhodecode.model.db import User, ChangesetStatus -age = lambda x,y=False: _age(x,y) +age = lambda x, y=False: _age(x, y) capitalize = lambda x: x.capitalize() email = author_email short_id = lambda x: x[:12] hide_credentials = lambda x: ''.join(credentials_filter(x)) +def show_id(cs): + """ + Configurable function that shows ID + by default it's r123:fffeeefffeee + + :param cs: changeset instance + """ + from rhodecode import CONFIG + def_len = safe_int(CONFIG['sha_len']) + show_rev = str2bool(CONFIG['sha_rev']) + + raw_id = cs.raw_id[:def_len] + if show_rev: + return 'r%s:%s' % (cs.revision, raw_id) + else: + return '%s' % (raw_id) + + def fmt_date(date): if date: _fmt = _(u"%a, %d %b %Y %H:%M:%S").encode('utf8') diff --git a/rhodecode/templates/changelog/changelog.html b/rhodecode/templates/changelog/changelog.html --- a/rhodecode/templates/changelog/changelog.html +++ b/rhodecode/templates/changelog/changelog.html @@ -64,8 +64,7 @@ - ${cs.revision}: - ${h.short_id(cs.raw_id)} + ${h.show_id(cs)} diff --git a/rhodecode/tests/functional/test_changelog.py b/rhodecode/tests/functional/test_changelog.py --- a/rhodecode/tests/functional/test_changelog.py +++ b/rhodecode/tests/functional/test_changelog.py @@ -15,11 +15,9 @@ class TestChangelogController(TestContro """name="5e204e7583b9c8e7b93a020bd036564b1e731dae" """ """type="checkbox" value="1" />""" ) + response.mustcontain( - """154:""" - ) - response.mustcontain( - """5e204e7583b9""" + """r154:5e204e7583b9""" ) response.mustcontain("""Small update at simplevcs app""") @@ -31,16 +29,18 @@ class TestChangelogController(TestContro # """more details">3""" # ) + def test_index_pagination_hg(self): + self.log_user() #pagination - response = self.app.get(url(controller='changelog', action='index', + self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page': 1}) - response = self.app.get(url(controller='changelog', action='index', + self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page': 2}) - response = self.app.get(url(controller='changelog', action='index', + self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page': 3}) - response = self.app.get(url(controller='changelog', action='index', + self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page': 4}) - response = self.app.get(url(controller='changelog', action='index', + self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page': 5}) response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page': 6}) @@ -52,11 +52,9 @@ class TestChangelogController(TestContro """name="46ad32a4f974e45472a898c6b0acb600320579b1" """ """type="checkbox" value="1" />""" ) + response.mustcontain( - """64:""" - ) - response.mustcontain( - """46ad32a4f974""" + """r64:46ad32a4f974""" ) # response.mustcontain( @@ -72,3 +70,57 @@ class TestChangelogController(TestContro # """title="Merge with 2e6a2bf9356ca56df08807f4ad86d480da72a8f4">""" # """46ad32a4f974""" % HG_REPO # ) + + def test_index_git(self): + self.log_user() + response = self.app.get(url(controller='changelog', action='index', + repo_name=GIT_REPO)) + + response.mustcontain('''id="chg_20" class="container tablerow1"''') + response.mustcontain( + """""" + ) + + response.mustcontain( + """r613:95f9a91d775b""" + ) + + response.mustcontain("""fixing stupid typo in context for mercurial""") + +# response.mustcontain( +# """
3
""" +# ) + + def test_index_pagination_git(self): + self.log_user() + #pagination + self.app.get(url(controller='changelog', action='index', + repo_name=GIT_REPO), {'page': 1}) + self.app.get(url(controller='changelog', action='index', + repo_name=GIT_REPO), {'page': 2}) + self.app.get(url(controller='changelog', action='index', + repo_name=GIT_REPO), {'page': 3}) + self.app.get(url(controller='changelog', action='index', + repo_name=GIT_REPO), {'page': 4}) + self.app.get(url(controller='changelog', action='index', + repo_name=GIT_REPO), {'page': 5}) + response = self.app.get(url(controller='changelog', action='index', + repo_name=GIT_REPO), {'page': 6}) + + # Test response after pagination... + response.mustcontain( + """""" + ) + + response.mustcontain( + """r515:636ed213f2f1""" + ) diff --git a/test.ini b/test.ini --- a/test.ini +++ b/test.ini @@ -25,69 +25,88 @@ pdebug = false #smtp_port = #smtp_use_tls = false #smtp_use_ssl = true -# Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.) +## Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.) #smtp_auth = [server:main] ## PASTE -##nr of threads to spawn +## nr of threads to spawn #threadpool_workers = 5 -##max request before thread respawn +## max request before thread respawn #threadpool_max_requests = 10 -##option to use threads of process +## option to use threads of process #use_threadpool = true #use = egg:Paste#http -#WAITRESS +## WAITRESS threads = 5 -#100GB +## 100GB max_request_body_size = 107374182400 use = egg:waitress#main host = 127.0.0.1 port = 5000 -[filter:proxy-prefix] -# prefix middleware for rc -use = egg:PasteDeploy#prefix -prefix = / +## prefix middleware for rc +#[filter:proxy-prefix] +#use = egg:PasteDeploy#prefix +#prefix = / [app:main] use = egg:rhodecode +## enable proxy prefix middleware #filter-with = proxy-prefix + full_stack = true static_files = true -# Optional Languages -# en, fr, ja, pt_BR, zh_CN, zh_TW, pl +## Optional Languages +## en, fr, ja, pt_BR, zh_CN, zh_TW, pl lang = en cache_dir = /tmp/rc/data index_dir = /tmp/rc/index -# set this path to use archive download cache -#archive_cache_dir = /tmp/rhodecode_tarballcache -app_instance_uuid = develop-test + +## uncomment and set this path to use archive download cache +#archive_cache_dir = /tmp/tarballcache + +## change this to unique ID for security +app_instance_uuid = rc-production + +## cut off limit for large diffs (size in bytes) cut_off_limit = 256000 -vcs_full_cache = False -# force https in RhodeCode, fixes https redirects, assumes it's always https + +## use cache version of scm repo everywhere +vcs_full_cache = false + +## force https in RhodeCode, fixes https redirects, assumes it's always https force_https = false -# use Strict-Transport-Security headers + +## use Strict-Transport-Security headers use_htsts = false + +## number of commits stats will parse on each iteration commit_parse_limit = 25 -# number of items displayed in lightweight dashboard before paginating + +## number of items displayed in lightweight dashboard before paginating is shown dashboard_items = 100 + +## use gravatar service to display avatars use_gravatar = true -# path to git executable +## path to git executable git_path = git ## RSS feed options - rss_cut_off_limit = 256000 rss_items_per_page = 10 rss_include_diff = false +## show hash options for changelog +sha_len = 12 +sha_rev = true + ## alternative_gravatar_url allows you to use your own avatar server application ## the following parts of the URL will be replaced @@ -99,8 +118,11 @@ rss_include_diff = false #alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size} #alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size} + +## container auth options container_auth_enabled = false proxypass_auth_enabled = false + ## default encoding used to convert from and to unicode ## can be also a comma seperated list of encoding in case of mixed encodings default_encoding = utf8 @@ -156,6 +178,11 @@ instance_id = ## handling that. Set this variable to 403 to return HTTPForbidden auth_ret_code = +## locking return code. When repository is locked return this HTTP code. 2XX +## codes don't break the transactions while 4XX codes do +lock_ret_code = 423 + + #################################### ### CELERY CONFIG #### #################################### @@ -180,7 +207,7 @@ celeryd.concurrency = 2 celeryd.log.level = debug celeryd.max.tasks.per.child = 1 -#tasks will never be sent to the queue, but executed locally instead. +## tasks will never be sent to the queue, but executed locally instead. celery.always.eager = false #################################### @@ -236,18 +263,19 @@ beaker.cache.sql_cache_long.key_length = beaker.session.key = rhodecode -## secure cookie requires AES python libraries ## -#beaker.session.encrypt_key = g654dcno0-9873jhgfreyu -#beaker.session.validate_key = 9712sds2212c--zxc123 +## secure cookie requires AES python libraries +#beaker.session.encrypt_key = +#beaker.session.validate_key = + ## sets session as invalid if it haven't been accessed for given amount of time beaker.session.timeout = 3600 beaker.session.httponly = true #beaker.session.cookie_path = / -## uncomment for https secure cookie ## +## uncomment for https secure cookie beaker.session.secure = false -## auto save the session to not to use .save() ## +## auto save the session to not to use .save() beaker.session.auto = False ## default cookie expiration time in seconds `true` expire at browser close ## @@ -262,57 +290,57 @@ beaker.session.auto = False ### [errormator] ### #################### -# Errormator is tailored to work with RhodeCode, see -# http://errormator.com for details how to obtain an account -# you must install python package `errormator_client` to make it work +## Errormator is tailored to work with RhodeCode, see +## http://errormator.com for details how to obtain an account +## you must install python package `errormator_client` to make it work -# errormator enabled -errormator = true +## errormator enabled +errormator = false errormator.server_url = https://api.errormator.com errormator.api_key = YOUR_API_KEY -# TWEAK AMOUNT OF INFO SENT HERE +## TWEAK AMOUNT OF INFO SENT HERE -# enables 404 error logging (default False) +## enables 404 error logging (default False) errormator.report_404 = false -# time in seconds after request is considered being slow (default 1) +## time in seconds after request is considered being slow (default 1) errormator.slow_request_time = 1 -# record slow requests in application -# (needs to be enabled for slow datastore recording and time tracking) +## record slow requests in application +## (needs to be enabled for slow datastore recording and time tracking) errormator.slow_requests = true -# enable hooking to application loggers +## enable hooking to application loggers # errormator.logging = true -# minimum log level for log capture +## minimum log level for log capture # errormator.logging.level = WARNING -# send logs only from erroneous/slow requests -# (saves API quota for intensive logging) +## send logs only from erroneous/slow requests +## (saves API quota for intensive logging) errormator.logging_on_error = false -# list of additonal keywords that should be grabbed from environ object -# can be string with comma separated list of words in lowercase -# (by default client will always send following info: -# 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that -# start with HTTP* this list be extended with additional keywords here +## list of additonal keywords that should be grabbed from environ object +## can be string with comma separated list of words in lowercase +## (by default client will always send following info: +## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that +## start with HTTP* this list be extended with additional keywords here errormator.environ_keys_whitelist = -# list of keywords that should be blanked from request object -# can be string with comma separated list of words in lowercase -# (by default client will always blank keys that contain following words -# 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' -# this list be extended with additional keywords set here +## list of keywords that should be blanked from request object +## can be string with comma separated list of words in lowercase +## (by default client will always blank keys that contain following words +## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' +## this list be extended with additional keywords set here errormator.request_keys_blacklist = -# list of namespaces that should be ignores when gathering log entries -# can be string with comma separated list of namespaces -# (by default the client ignores own entries: errormator_client.client) +## list of namespaces that should be ignores when gathering log entries +## can be string with comma separated list of namespaces +## (by default the client ignores own entries: errormator_client.client) errormator.log_namespace_blacklist = @@ -320,8 +348,8 @@ errormator.log_namespace_blacklist = ### [sentry] ### ################ -# sentry is a alternative open source error aggregator -# you must install python packages `sentry` and `raven` to enable +## sentry is a alternative open source error aggregator +## you must install python packages `sentry` and `raven` to enable sentry.dsn = YOUR_DNS sentry.servers = @@ -366,10 +394,10 @@ sqlalchemy.db1.convert_unicode = true keys = root, routes, rhodecode, sqlalchemy, beaker, templates, whoosh_indexer [handlers] -keys = console +keys = console, console_sql [formatters] -keys = generic, color_formatter +keys = generic, color_formatter, color_formatter_sql ############# ## LOGGERS ## @@ -382,7 +410,7 @@ handlers = console level = DEBUG handlers = qualname = routes.middleware -# "level = DEBUG" logs the route matched and routing variables. +## "level = DEBUG" logs the route matched and routing variables. propagate = 1 [logger_beaker] @@ -425,6 +453,12 @@ args = (sys.stderr,) level = NOTSET formatter = generic +[handler_console_sql] +class = StreamHandler +args = (sys.stderr,) +level = WARN +formatter = generic + ################ ## FORMATTERS ## ################ @@ -437,3 +471,8 @@ datefmt = %Y-%m-%d %H:%M:%S class=rhodecode.lib.colored_formatter.ColorFormatter format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s datefmt = %Y-%m-%d %H:%M:%S + +[formatter_color_formatter_sql] +class=rhodecode.lib.colored_formatter.ColorFormatterSql +format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s +datefmt = %Y-%m-%d %H:%M:%S