Show More
@@ -158,7 +158,7 b' api_access_controllers_whitelist =' | |||||
158 |
|
158 | |||
159 | ## default encoding used to convert from and to unicode |
|
159 | ## default encoding used to convert from and to unicode | |
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 = utf-8 | |
162 |
|
162 | |||
163 | ## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea |
|
163 | ## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea | |
164 | hgencoding = utf-8 |
|
164 | hgencoding = utf-8 |
@@ -475,7 +475,7 b' def show_id(cs):' | |||||
475 |
|
475 | |||
476 | def fmt_date(date): |
|
476 | def fmt_date(date): | |
477 | if date: |
|
477 | if date: | |
478 | return date.strftime("%Y-%m-%d %H:%M:%S").decode('utf8') |
|
478 | return date.strftime("%Y-%m-%d %H:%M:%S").decode('utf-8') | |
479 |
|
479 | |||
480 | return "" |
|
480 | return "" | |
481 |
|
481 |
@@ -176,7 +176,7 b' class GitRepository(object):' | |||||
176 | update_server_info(repo._repo) |
|
176 | update_server_info(repo._repo) | |
177 |
|
177 | |||
178 | resp = Response() |
|
178 | resp = Response() | |
179 | resp.content_type = 'application/x-%s-result' % git_command.encode('utf8') |
|
179 | resp.content_type = 'application/x-%s-result' % git_command.encode('utf-8') | |
180 | resp.charset = None |
|
180 | resp.charset = None | |
181 | resp.app_iter = out |
|
181 | resp.app_iter = out | |
182 | return resp |
|
182 | return resp |
@@ -252,7 +252,7 b' api_access_controllers_whitelist =' | |||||
252 |
|
252 | |||
253 | <%text>## default encoding used to convert from and to unicode</%text> |
|
253 | <%text>## default encoding used to convert from and to unicode</%text> | |
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 = utf-8 | |
256 |
|
256 | |||
257 | <%text>## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea</%text> |
|
257 | <%text>## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea</%text> | |
258 | hgencoding = utf-8 |
|
258 | hgencoding = utf-8 |
@@ -435,7 +435,7 b' def set_vcs_config(config):' | |||||
435 | conf.settings.GIT_EXECUTABLE_PATH = config.get('git_path', 'git') |
|
435 | conf.settings.GIT_EXECUTABLE_PATH = config.get('git_path', 'git') | |
436 | conf.settings.GIT_REV_FILTER = config.get('git_rev_filter', '--all').strip() |
|
436 | conf.settings.GIT_REV_FILTER = config.get('git_rev_filter', '--all').strip() | |
437 | conf.settings.DEFAULT_ENCODINGS = aslist(config.get('default_encoding', |
|
437 | conf.settings.DEFAULT_ENCODINGS = aslist(config.get('default_encoding', | |
438 | 'utf8'), sep=',') |
|
438 | 'utf-8'), sep=',') | |
439 |
|
439 | |||
440 |
|
440 | |||
441 | def set_indexer_config(config): |
|
441 | def set_indexer_config(config): |
@@ -176,7 +176,7 b' def safe_unicode(str_, from_encoding=Non' | |||||
176 | if not from_encoding: |
|
176 | if not from_encoding: | |
177 | import kallithea |
|
177 | import kallithea | |
178 | DEFAULT_ENCODINGS = aslist(kallithea.CONFIG.get('default_encoding', |
|
178 | DEFAULT_ENCODINGS = aslist(kallithea.CONFIG.get('default_encoding', | |
179 | 'utf8'), sep=',') |
|
179 | 'utf-8'), sep=',') | |
180 | from_encoding = DEFAULT_ENCODINGS |
|
180 | from_encoding = DEFAULT_ENCODINGS | |
181 |
|
181 | |||
182 | if not isinstance(from_encoding, (list, tuple)): |
|
182 | if not isinstance(from_encoding, (list, tuple)): | |
@@ -225,7 +225,7 b' def safe_str(unicode_, to_encoding=None)' | |||||
225 | if not to_encoding: |
|
225 | if not to_encoding: | |
226 | import kallithea |
|
226 | import kallithea | |
227 | DEFAULT_ENCODINGS = aslist(kallithea.CONFIG.get('default_encoding', |
|
227 | DEFAULT_ENCODINGS = aslist(kallithea.CONFIG.get('default_encoding', | |
228 | 'utf8'), sep=',') |
|
228 | 'utf-8'), sep=',') | |
229 | to_encoding = DEFAULT_ENCODINGS |
|
229 | to_encoding = DEFAULT_ENCODINGS | |
230 |
|
230 | |||
231 | if not isinstance(to_encoding, (list, tuple)): |
|
231 | if not isinstance(to_encoding, (list, tuple)): |
@@ -53,7 +53,7 b' class MercurialInMemoryChangeset(BaseInM' | |||||
53 | for node in self.added: |
|
53 | for node in self.added: | |
54 | if node.path == path: |
|
54 | if node.path == path: | |
55 | return memfilectx(_repo, memctx, path=node.path, |
|
55 | return memfilectx(_repo, memctx, path=node.path, | |
56 | data=(node.content.encode('utf8') |
|
56 | data=(node.content.encode('utf-8') | |
57 | if not node.is_binary else node.content), |
|
57 | if not node.is_binary else node.content), | |
58 | islink=False, |
|
58 | islink=False, | |
59 | isexec=node.is_executable, |
|
59 | isexec=node.is_executable, | |
@@ -63,7 +63,7 b' class MercurialInMemoryChangeset(BaseInM' | |||||
63 | for node in self.changed: |
|
63 | for node in self.changed: | |
64 | if node.path == path: |
|
64 | if node.path == path: | |
65 | return memfilectx(_repo, memctx, path=node.path, |
|
65 | return memfilectx(_repo, memctx, path=node.path, | |
66 | data=(node.content.encode('utf8') |
|
66 | data=(node.content.encode('utf-8') | |
67 | if not node.is_binary else node.content), |
|
67 | if not node.is_binary else node.content), | |
68 | islink=False, |
|
68 | islink=False, | |
69 | isexec=node.is_executable, |
|
69 | isexec=node.is_executable, |
@@ -17,7 +17,7 b' if os.path.isdir(VCSRC_PATH):' | |||||
17 | VCSRC_PATH = os.path.join(VCSRC_PATH, '__init__.py') |
|
17 | VCSRC_PATH = os.path.join(VCSRC_PATH, '__init__.py') | |
18 |
|
18 | |||
19 | # list of default encoding used in safe_unicode/safe_str methods |
|
19 | # list of default encoding used in safe_unicode/safe_str methods | |
20 | DEFAULT_ENCODINGS = aslist('utf8') |
|
20 | DEFAULT_ENCODINGS = aslist('utf-8') | |
21 |
|
21 | |||
22 | # path to git executable run by run_git_command function |
|
22 | # path to git executable run by run_git_command function | |
23 | GIT_EXECUTABLE_PATH = 'git' |
|
23 | GIT_EXECUTABLE_PATH = 'git' |
@@ -1,4 +1,4 b'' | |||||
1 | # encoding: utf8 |
|
1 | # encoding: utf-8 | |
2 |
|
2 | |||
3 | import time |
|
3 | import time | |
4 | import datetime |
|
4 | import datetime |
@@ -1,4 +1,4 b'' | |||||
1 | # encoding: utf8 |
|
1 | # encoding: utf-8 | |
2 | """ |
|
2 | """ | |
3 | Tests so called "in memory changesets" commit API of vcs. |
|
3 | Tests so called "in memory changesets" commit API of vcs. | |
4 | """ |
|
4 | """ |
@@ -143,7 +143,7 b' def sortkey(x):' | |||||
143 | return (x[0] and -int(x[0][-1]), |
|
143 | return (x[0] and -int(x[0][-1]), | |
144 | x[0] and int(x[0][0]), |
|
144 | x[0] and int(x[0][0]), | |
145 | -len(x[0]), |
|
145 | -len(x[0]), | |
146 | x[1].decode('utf8').lower().replace(u'\xe9', u'e').replace(u'\u0142', u'l') |
|
146 | x[1].decode('utf-8').lower().replace(u'\xe9', u'e').replace(u'\u0142', u'l') | |
147 | ) |
|
147 | ) | |
148 |
|
148 | |||
149 |
|
149 |
General Comments 0
You need to be logged in to leave comments.
Login now