Edgewall Software

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#12891 closed defect (fixed)

Refactor do_initenv method

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.3.3
Component: admin/console Version:
Severity: normal Keywords: initenv
Cc: Branch:
Release Notes:
  • Removed repostype and repospath arguments from TracAdmin initenv command.
  • All cached repositories are synchronized on environment creation.
API Changes:
  • Environment.create raises a TracError if the base directory of the path does not exist or the path is not an empty directory.
  • RepositoryManager.get_real_repositories returns a sorted list rather than a set.
Internal Changes:


IEnvironmentSetupParticipant.environment_created is used to do some of the work in creating an environment:

However, there is an inconsistency in that other module-specific operations are done in console.py:

  • Loading default pages
  • Synchronizing the default repository
  • Adding default values for [mainnav] and [metanav] sections

It seems like that work should be moved to IEnvironmentSetupParticipant implementations.

Attachments (0)

Change History (5)

comment:1 by Ryan J Ollos, 6 years ago

With svn and git in tracopt, repositories can only be synchronized on environment creation if --inherit or --config is used to enable the components. Example:

tracopt.versioncontrol.* = enabled

cached_repository = true

repos1.type = git
repos1.dir = /Users/rjollos/Documents/Workspace/trac-dev/repos/git/repos1
repos2.type = svn
repos2.dir = /Users/rjollos/Documents/Workspace/trac-dev/repos/svn/proj1
.type = direct-svnfs
.dir = /Users/rjollos/Documents/Workspace/trac-dev/repos/svn/proj2


  • I think it makes sense to synchronize all repositories on environment creation, not just the default, since multiple repositories can be specified in the --inherit or --config file.
  • The initenv arguments <repostype> and <repospath> have very limited usefulness:
    • Trac is multi-repository and they only allow setting the default repository
    • Unless the version control components are enabled, the only effect is to add the options to the config. The repositories are not available because the connector is not enabled, and the repositories are not synced.

The arguments probably should have been at least deprecated with the addition of multi-repository in 0.12. I think it makes sense to just remove the arguments so as to not confuse the user with all the caveats involved with using the arguments. This will be a backward-incompatible change, so let me know if it will cause you problems.

Changes in log:rjollos.git:t12891_refactor_initenv.

comment:2 by Ryan J Ollos, 6 years ago

API Changes: modified (diff)
Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to trunk in r16244 and r16245. I'll propose additional related changes later on, probably for milestone:1.5.1.

Documentation updated in 1.3/TracEnvironment@2.

Last edited 6 years ago by Ryan J Ollos (previous) (diff)

comment:3 by Ryan J Ollos, 6 years ago

Additional documentation updates related to configuration in comment:1:

Last edited 6 years ago by Ryan J Ollos (previous) (diff)

comment:4 by Ryan J Ollos, 4 years ago

Release Notes: modified (diff)

comment:5 by Ryan J Ollos, 4 years ago

See also #13290 for a change that should have been done here.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.