Opened 9 years ago
Last modified 4 years ago
#12119 new enhancement
Options not written to trac.ini when --inherit option used
Reported by: | Ryan J Ollos | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | next-major-releases |
Component: | database backend | Version: | |
Severity: | normal | Keywords: | config |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Tested with the latest trunk r14154. The trac.ini file on the left was created using an empty inherited file --inherit=`pwd`/global.ini
. The file on the right was created without specifying --inherit
. It seems many options are missing from trac.ini
when --inherit
is used.
It seems only ConfigSection
s and options explicitly specified when creating the environment are written. In the case that a ConfigSection
is specified in the inherited file it won't be written.
The possible reason for not writing an option when there is an inherited file is to avoid having to delete the option from trac.ini when it is added to the inherited file. It seems inconsistent though to have only ConfigSection
s in trac.ini.
I'll have to investigate if the behavior changed after #11437.
-
conf/trac.ini
old new 1 1 # -*- coding: utf-8 -*- 2 2 3 [attachment] 4 max_size = 262144 5 max_zip_size = 2097152 6 render_unsafe_content = disabled 7 8 [browser] 9 color_scale = enabled 10 downloadable_paths = /trunk,/branches/*,/tags/* 11 hide_properties = svk:merge 12 intermediate_color = 13 intermediate_point = 14 newest_color = (255, 136, 136) 15 oldest_color = (136, 136, 255) 16 oneliner_properties = trac:summary 17 render_unsafe_content = disabled 18 wiki_properties = trac:description 19 20 [changeset] 21 max_diff_bytes = 10000000 22 max_diff_files = 0 23 wiki_format_messages = enabled 24 25 [header_logo] 26 alt = (please configure the [header_logo] section in trac.ini) 27 height = -1 28 link = 29 src = site/your_project_logo.png 30 width = -1 31 3 32 [inherit] 4 file = /home/user/Workspace/test-inherit/global.ini 33 htdocs_dir = 34 plugins_dir = 35 templates_dir = 36 37 [logging] 38 log_file = trac.log 39 log_format = 40 log_level = DEBUG 41 log_type = none 5 42 6 43 [mainnav] 7 44 admin.order = 8.0 … … 20 57 logout.order = 2.0 21 58 prefs.order = 3.0 22 59 60 [milestone] 61 default_retarget_to = 62 stats_provider = DefaultTicketGroupStatsProvider 63 64 [mimeviewer] 65 max_preview_size = 262144 66 mime_map = text/x-dylan:dylan,text/x-idl:ice,text/x-ada:ads:adb 67 mime_map_patterns = text/plain:README|INSTALL|COPYING.* 68 pygments_default_style = trac 69 pygments_modes = 70 tab_width = 8 71 treat_as_binary = application/octet-stream,application/pdf,application/postscript,application/msword,application/rtf 72 73 [notification] 74 admit_domains = 75 ambiguous_char_width = single 76 batch_subject_template = $prefix Batch modify: $tickets_descr 77 email_address_resolvers = SessionEmailResolver 78 email_sender = SmtpEmailSender 79 ignore_domains = 80 mime_encoding = none 81 sendmail_path = sendmail 82 smtp_always_bcc = 83 smtp_always_cc = 84 smtp_default_domain = 85 smtp_enabled = disabled 86 smtp_from = trac@localhost 87 smtp_from_author = disabled 88 smtp_from_name = 89 smtp_password = 90 smtp_port = 25 91 smtp_replyto = trac@localhost 92 smtp_server = localhost 93 smtp_subject_prefix = __default__ 94 smtp_user = 95 ticket_subject_template = $prefix #$ticket.id: $summary 96 use_public_cc = disabled 97 use_short_addr = disabled 98 use_tls = disabled 99 23 100 [notification-subscriber] 24 101 always_notify_cc = CarbonCopySubscriber 25 102 always_notify_previous_updater = TicketPreviousUpdatersSubscriber 26 103 always_notify_updater = TicketUpdaterSubscriber 27 104 28 105 [project] 106 admin = 107 admin_trac_url = . 108 descr = My example project 109 footer = Visit the Trac open source project at<br /><a href="http://trac.edgewall.org/">http://trac.edgewall.org/</a> 110 icon = common/trac.ico 29 111 name = My Project 112 url = 113 114 [query] 115 default_anonymous_query = status!=closed&cc~=$USER 116 default_query = status!=closed&owner=$USER 117 items_per_page = 100 118 ticketlink_query = ?status=!closed 119 120 [report] 121 items_per_page = 100 122 items_per_page_rss = 0 123 124 [revisionlog] 125 default_log_limit = 100 126 graph_colors = #cc0,#0c0,#0cc,#00c,#c0c,#c00 127 128 [roadmap] 129 stats_provider = DefaultTicketGroupStatsProvider 130 131 [search] 132 default_disabled_filters = 133 min_query_length = 3 134 135 [sqlite] 136 extensions = 137 138 [svn] 139 authz_file = 140 authz_module_name = 141 142 [ticket] 143 allowed_empty_fields = milestone,version 144 default_cc = 145 default_component = 146 default_description = 147 default_keywords = 148 default_milestone = 149 default_owner = < default > 150 default_priority = major 151 default_resolution = fixed 152 default_severity = 153 default_summary = 154 default_type = defect 155 default_version = 156 max_comment_size = 262144 157 max_description_size = 262144 158 max_summary_size = 262144 159 preserve_newlines = default 160 restrict_owner = disabled 161 workflow = ConfigurableTicketWorkflow 30 162 31 163 [ticket-workflow] 32 164 accept = new,assigned,accepted,reopened -> accepted … … 51 183 resolve.operations = set_resolution 52 184 resolve.permissions = TICKET_MODIFY 53 185 186 [timeline] 187 abbreviated_messages = enabled 188 changeset_collapse_events = disabled 189 changeset_long_messages = disabled 190 changeset_show_files = 0 191 default_daysback = 30 192 max_daysback = 90 193 newticket_formatter = oneliner 194 ticket_show_component = disabled 195 ticket_show_details = disabled 196 54 197 [trac] 198 auth_cookie_lifetime = 0 199 auth_cookie_path = 200 auto_preview_timeout = 2.0 201 auto_reload = disabled 202 backup_dir = db 203 base_url = 204 check_auth_ip = disabled 55 205 database = sqlite:db/trac.db 206 debug_sql = disabled 207 default_charset = utf-8 208 default_date_format = 209 default_dateinfo_format = relative 210 default_handler = WikiModule 211 default_language = 212 default_timezone = 213 genshi_cache_size = 128 214 htdocs_location = 215 ignore_auth_case = disabled 216 jquery_location = 217 jquery_ui_location = 218 jquery_ui_theme_location = 219 never_obfuscate_mailto = disabled 220 permission_policies = ReadonlyWikiPolicy,DefaultPermissionPolicy,LegacyAttachmentPolicy 221 permission_store = DefaultPermissionStore 222 request_filters = 223 resizable_textareas = enabled 224 secure_cookies = disabled 225 show_email_addresses = disabled 226 show_ip_addresses = disabled 227 timeout = 20 228 use_base_url_for_redirect = disabled 229 use_chunked_encoding = disabled 230 use_xsendfile = disabled 231 wiki_toolbars = enabled 232 xsendfile_header = X-Sendfile 233 234 [versioncontrol] 235 allowed_repository_dir_prefixes = 236 default_repository_type = svn 237 238 [wiki] 239 default_edit_area_height = 20 240 ignore_missing_pages = disabled 241 max_size = 262144 242 render_unsafe_content = disabled 243 safe_schemes = cvs,file,ftp,git,irc,http,https,news,sftp,smb,ssh,svn,svn+ssh 244 split_page_names = disabled
Attachments (0)
Change History (4)
follow-up: 4 comment:1 by , 9 years ago
comment:2 by , 9 years ago
I see that the behavior described in comment:description is documented: tags/trac-1.1.5/trac/env.py@:548-550#L543.
comment:3 by , 9 years ago
Milestone: | next-dev-1.1.x → next-major-releases |
---|---|
Type: | defect → enhancement |
comment:4 by , 7 years ago
Replying to Ryan J Ollos:
Since the directory cannot already exist when creating an environment, it seems it would not be possible to use a relative path for the
--inherit
option.
It does work, it's just a bit confusing.
$ ls inherit.ini inherit.ini $ trac-admin env initenv --inherit=../../inherit.ini "My Project" sqlite:db/trac.db
It might be more clear to resolve relative paths to the current directory and then prefix the inherit option with ../..
when writing to trac.ini. It's probably not worth bothering with now.
I also noticed that the following documentation may be inaccurate:
Regarding Relative paths are resolved relative to the "conf" directory of the new environment:
Since the directory cannot already exist when creating an environment, it seems it would not be possible to use a relative path for the
--inherit
option.