##// END OF EJS Templates
hg: set encoding to utf-8 by default to always show unicode characters correctly...
Mads Kiilerich -
r7249:9937ae52 default
parent child Browse files
Show More
@@ -160,6 +160,9 b' api_access_controllers_whitelist ='
160 ## can be also a comma separated list of encoding in case of mixed encodings
160 ## can be also a comma separated list of encoding in case of mixed encodings
161 default_encoding = utf8
161 default_encoding = utf8
162
162
163 ## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea
164 hgencoding = utf-8
165
163 ## issue tracker for Kallithea (leave blank to disable, absent for default)
166 ## issue tracker for Kallithea (leave blank to disable, absent for default)
164 #bugtracker = https://bitbucket.org/conservancy/kallithea/issues
167 #bugtracker = https://bitbucket.org/conservancy/kallithea/issues
165
168
@@ -633,6 +633,9 b' encoding of commit messages. In addition'
633 library is installed. If ``chardet`` is detected Kallithea will fallback to it
633 library is installed. If ``chardet`` is detected Kallithea will fallback to it
634 when there are encode/decode errors.
634 when there are encode/decode errors.
635
635
636 The Mercurial encoding is configurable as ``hgencoding``. It is similar to
637 setting the ``HGENCODING`` environment variable, but will override it.
638
636
639
637 Celery configuration
640 Celery configuration
638 --------------------
641 --------------------
@@ -894,7 +897,6 b' Example WSGI dispatch script:'
894 .. code-block:: python
897 .. code-block:: python
895
898
896 import os
899 import os
897 os.environ["HGENCODING"] = "UTF-8"
898 os.environ['PYTHON_EGG_CACHE'] = '/srv/kallithea/.egg-cache'
900 os.environ['PYTHON_EGG_CACHE'] = '/srv/kallithea/.egg-cache'
899
901
900 # sometimes it's needed to set the current dir
902 # sometimes it's needed to set the current dir
@@ -28,6 +28,7 b' import alembic.config'
28 from alembic.script.base import ScriptDirectory
28 from alembic.script.base import ScriptDirectory
29 from alembic.migration import MigrationContext
29 from alembic.migration import MigrationContext
30 from sqlalchemy import create_engine
30 from sqlalchemy import create_engine
31 import mercurial
31
32
32 from kallithea.lib.middleware.https_fixup import HttpsFixup
33 from kallithea.lib.middleware.https_fixup import HttpsFixup
33 from kallithea.lib.middleware.simplegit import SimpleGit
34 from kallithea.lib.middleware.simplegit import SimpleGit
@@ -119,6 +120,11 b' else:'
119 def setup_configuration(app):
120 def setup_configuration(app):
120 config = app.config
121 config = app.config
121
122
123 # Mercurial sets encoding at module import time, so we have to monkey patch it
124 hgencoding = config.get('hgencoding')
125 if hgencoding:
126 mercurial.encoding.encoding = hgencoding
127
122 if config.get('ignore_alembic_revision', False):
128 if config.get('ignore_alembic_revision', False):
123 log.warn('database alembic revision checking is disabled')
129 log.warn('database alembic revision checking is disabled')
124 else:
130 else:
@@ -254,6 +254,9 b' api_access_controllers_whitelist ='
254 <%text>## can be also a comma separated list of encoding in case of mixed encodings</%text>
254 <%text>## can be also a comma separated list of encoding in case of mixed encodings</%text>
255 default_encoding = utf8
255 default_encoding = utf8
256
256
257 <%text>## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea</%text>
258 hgencoding = utf-8
259
257 <%text>## issue tracker for Kallithea (leave blank to disable, absent for default)</%text>
260 <%text>## issue tracker for Kallithea (leave blank to disable, absent for default)</%text>
258 #bugtracker = https://bitbucket.org/conservancy/kallithea/issues
261 #bugtracker = https://bitbucket.org/conservancy/kallithea/issues
259
262
General Comments 0
You need to be logged in to leave comments. Login now