#11776 closed enhancement (fixed)
Move the repository_sync_per_request configuration option to the repositories section — at Version 9
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.3 |
Component: | version control | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
The
The |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
As described in comment:1:ticket:11703, move the [trac] repository_sync_per_request
configuration option to the [repositories]
section:
[repositories] <name>.sync_per_request = true/false
and similarly add an attribute for repositories defined through DbRepostioryProvider
. Also, allow the option to be configurable from the repositories web admin page. This might help with configuration issues like the one reported in #11767.
Change History (9)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 years ago
Status: | new → assigned |
---|
comment:3 by , 9 years ago
comment:5 by , 9 years ago
Changes for #11703 will need to be committed before these changes. Committing these changes first leads to test failures since there's no way to define explicit synchronization for the repository defined in [trac] repository_dir
, and some tests in trac/versioncontrol/tests/functional.py
depend on explicit synchronization.
comment:6 by , 9 years ago
I just confirmed rjollos.git@t11776.1.
- Even if
sync_per_request
is0
, sync is executed by each request. - Synchronized '(default)' repository … is not logged even if sync is successful.
- If Sync on every request is Not recommended, I think the option should be disabled for new repository by default. Adding a large repository from repository admin panel, a user would have a long wait for next request.
-
trac/versioncontrol/api.py
diff --git a/trac/versioncontrol/api.py b/trac/versioncontrol/api.py index 9b4e28e..0b33b6b 100644
a b class DbRepositoryProvider(Component): 221 221 "INSERT INTO repository (id, name, value) VALUES (%s, %s, %s)", 222 222 [(id, 'dir', dir), 223 223 (id, 'type', type_ or ''), 224 (id, 'sync_per_request', ' 1')])224 (id, 'sync_per_request', '0')]) 225 225 rm.reload_repositories() 226 226 227 227 def add_alias(self, reponame, target): … … class RepositoryManager(Component): 336 336 from trac.web.chrome import Chrome, add_warning 337 337 if handler is not Chrome(self.env): 338 338 for repo_info in self.get_all_repositories().values(): 339 if not repo_info.get('sync_per_request'):339 if not as_bool(repo_info.get('sync_per_request')): 340 340 continue 341 341 start = time.time() 342 342 repo_name = repo_info['name'] or '(default)' 343 343 try: 344 344 repo = self.get_repository(repo_info['name']) 345 345 repo.sync() 346 continue347 346 except TracError as e: 348 347 add_warning(req, 349 348 _("Can't synchronize with repository \"%(name)s\" "
comment:7 by , 9 years ago
- We should use
i18n:msg
for span of new hint.
-
trac/versioncontrol/templates/admin_repositories.html
diff --git a/trac/versioncontrol/templates/admin_repositories.html b/trac/versioncontrol/templates/admin_repositories.html index 8ad06a3..7df1daa 100644
a b 86 86 disabled="${not info.editable or None}" /> 87 87 Sync on every request 88 88 </label> 89 <span class="hint" >Not recommended. See <a href="${href.wiki('TracRepositoryAdmin') + '#ExplicitSync'}">explicit synchronization</a> for more info.</span>89 <span class="hint" i18n:msg="">Not recommended. See <a href="${href.wiki('TracRepositoryAdmin') + '#ExplicitSync'}">explicit synchronization</a> for more info.</span> 90 90 </div> 91 91 <div class="field"> 92 92 <label><input type="checkbox" name="hidden" value="1" checked="${info.hidden or None}"
comment:8 by , 9 years ago
Release Notes: | modified (diff) |
---|
comment:9 by , 9 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Thanks for the review and patches. Committed to trunk in [13393:13394].
Proposed changes in log:rjollos.git:t11776.1. TracRepositoryAdmin page modified to document these changes in 1.1/TracRepositoryAdmin@2.