Show More
@@ -7,13 +7,10 b' from rhodecode.lib.helpers import person' | |||
|
7 | 7 | from rhodecode.lib.smtp_mailer import SmtpMailer |
|
8 | 8 | from rhodecode.lib.utils import OrderedDict |
|
9 | 9 | from time import mktime |
|
10 | from vcs.backends.hg import MercurialRepository | |
|
11 | from vcs.backends.git import GitRepository | |
|
12 | 10 | import os |
|
13 | 11 | import traceback |
|
14 | 12 | from vcs.backends import get_repo |
|
15 | from vcs.utils.helpers import get_scm | |
|
16 | ||
|
13 | from rhodecode.model.hg import HgModel | |
|
17 | 14 | try: |
|
18 | 15 | import json |
|
19 | 16 | except ImportError: |
@@ -46,43 +43,6 b' def get_session():' | |||
|
46 | 43 | |
|
47 | 44 | return sa |
|
48 | 45 | |
|
49 | def get_hg_settings(): | |
|
50 | from rhodecode.model.db import RhodeCodeSettings | |
|
51 | sa = get_session() | |
|
52 | ret = sa.query(RhodeCodeSettings).all() | |
|
53 | ||
|
54 | if not ret: | |
|
55 | raise Exception('Could not get application settings !') | |
|
56 | settings = {} | |
|
57 | for each in ret: | |
|
58 | settings['rhodecode_' + each.app_settings_name] = each.app_settings_value | |
|
59 | ||
|
60 | return settings | |
|
61 | ||
|
62 | def get_hg_ui_settings(): | |
|
63 | from rhodecode.model.db import RhodeCodeUi | |
|
64 | sa = get_session() | |
|
65 | ret = sa.query(RhodeCodeUi).all() | |
|
66 | ||
|
67 | if not ret: | |
|
68 | raise Exception('Could not get application ui settings !') | |
|
69 | settings = {} | |
|
70 | for each in ret: | |
|
71 | k = each.ui_key | |
|
72 | v = each.ui_value | |
|
73 | if k == '/': | |
|
74 | k = 'root_path' | |
|
75 | ||
|
76 | if k.find('.') != -1: | |
|
77 | k = k.replace('.', '_') | |
|
78 | ||
|
79 | if each.ui_section == 'hooks': | |
|
80 | v = each.ui_active | |
|
81 | ||
|
82 | settings[each.ui_section + '_' + k] = v | |
|
83 | ||
|
84 | return settings | |
|
85 | ||
|
86 | 46 | @task |
|
87 | 47 | @locked_task |
|
88 | 48 | def whoosh_index(repo_location, full_index): |
@@ -101,7 +61,7 b' def get_commits_stats(repo_name, ts_min_' | |||
|
101 | 61 | |
|
102 | 62 | commits_by_day_author_aggregate = {} |
|
103 | 63 | commits_by_day_aggregate = {} |
|
104 |
repos_path = |
|
|
64 | repos_path = HgModel().repos_path | |
|
105 | 65 | p = os.path.join(repos_path, repo_name) |
|
106 | 66 | repo = get_repo(p) |
|
107 | 67 | |
@@ -297,7 +257,7 b' def create_repo_fork(form_data, cur_user' | |||
|
297 | 257 | repo_model = RepoModel(get_session()) |
|
298 | 258 | repo_model.create(form_data, cur_user, just_db=True, fork=True) |
|
299 | 259 | repo_name = form_data['repo_name'] |
|
300 |
repos_path = |
|
|
260 | repos_path = HgModel().repos_path | |
|
301 | 261 | repo_path = os.path.join(repos_path, repo_name) |
|
302 | 262 | repo_fork_path = os.path.join(repos_path, form_data['fork_name']) |
|
303 | 263 | alias = form_data['repo_type'] |
@@ -314,7 +274,7 b' def __get_codes_stats(repo_name):' | |||
|
314 | 274 | 's', 'sh', 'tpl', 'txt', 'vim', 'wss', 'xhtml', 'xml', 'xsl', 'xslt', 'yaws'] |
|
315 | 275 | |
|
316 | 276 | |
|
317 |
repos_path = |
|
|
277 | repos_path = HgModel().repos_path | |
|
318 | 278 | p = os.path.join(repos_path, repo_name) |
|
319 | 279 | repo = get_repo(p) |
|
320 | 280 | tip = repo.get_changeset() |
General Comments 0
You need to be logged in to leave comments.
Login now