Edgewall Software
Modify

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 ConfigSections 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 ConfigSections in trac.ini.

I'll have to investigate if the behavior changed after #11437.

  • conf/trac.ini

    old new  
    11# -*- coding: utf-8 -*-
    22
     3[attachment]
     4max_size = 262144
     5max_zip_size = 2097152
     6render_unsafe_content = disabled
     7
     8[browser]
     9color_scale = enabled
     10downloadable_paths = /trunk,/branches/*,/tags/*
     11hide_properties = svk:merge
     12intermediate_color =
     13intermediate_point =
     14newest_color = (255, 136, 136)
     15oldest_color = (136, 136, 255)
     16oneliner_properties = trac:summary
     17render_unsafe_content = disabled
     18wiki_properties = trac:description
     19
     20[changeset]
     21max_diff_bytes = 10000000
     22max_diff_files = 0
     23wiki_format_messages = enabled
     24
     25[header_logo]
     26alt = (please configure the [header_logo] section in trac.ini)
     27height = -1
     28link =
     29src = site/your_project_logo.png
     30width = -1
     31
    332[inherit]
    4 file = /home/user/Workspace/test-inherit/global.ini
     33htdocs_dir =
     34plugins_dir =
     35templates_dir =
     36
     37[logging]
     38log_file = trac.log
     39log_format =
     40log_level = DEBUG
     41log_type = none
    542
    643[mainnav]
    744admin.order = 8.0
     
    2057logout.order = 2.0
    2158prefs.order = 3.0
    2259
     60[milestone]
     61default_retarget_to =
     62stats_provider = DefaultTicketGroupStatsProvider
     63
     64[mimeviewer]
     65max_preview_size = 262144
     66mime_map = text/x-dylan:dylan,text/x-idl:ice,text/x-ada:ads:adb
     67mime_map_patterns = text/plain:README|INSTALL|COPYING.*
     68pygments_default_style = trac
     69pygments_modes =
     70tab_width = 8
     71treat_as_binary = application/octet-stream,application/pdf,application/postscript,application/msword,application/rtf
     72
     73[notification]
     74admit_domains =
     75ambiguous_char_width = single
     76batch_subject_template = $prefix Batch modify: $tickets_descr
     77email_address_resolvers = SessionEmailResolver
     78email_sender = SmtpEmailSender
     79ignore_domains =
     80mime_encoding = none
     81sendmail_path = sendmail
     82smtp_always_bcc =
     83smtp_always_cc =
     84smtp_default_domain =
     85smtp_enabled = disabled
     86smtp_from = trac@localhost
     87smtp_from_author = disabled
     88smtp_from_name =
     89smtp_password =
     90smtp_port = 25
     91smtp_replyto = trac@localhost
     92smtp_server = localhost
     93smtp_subject_prefix = __default__
     94smtp_user =
     95ticket_subject_template = $prefix #$ticket.id: $summary
     96use_public_cc = disabled
     97use_short_addr = disabled
     98use_tls = disabled
     99
    23100[notification-subscriber]
    24101always_notify_cc = CarbonCopySubscriber
    25102always_notify_previous_updater = TicketPreviousUpdatersSubscriber
    26103always_notify_updater = TicketUpdaterSubscriber
    27104
    28105[project]
     106admin =
     107admin_trac_url = .
     108descr = My example project
     109footer = Visit the Trac open source project at<br /><a href="http://trac.edgewall.org/">http://trac.edgewall.org/</a>
     110icon = common/trac.ico
    29111name = My Project
     112url =
     113
     114[query]
     115default_anonymous_query = status!=closed&cc~=$USER
     116default_query = status!=closed&owner=$USER
     117items_per_page = 100
     118ticketlink_query = ?status=!closed
     119
     120[report]
     121items_per_page = 100
     122items_per_page_rss = 0
     123
     124[revisionlog]
     125default_log_limit = 100
     126graph_colors = #cc0,#0c0,#0cc,#00c,#c0c,#c00
     127
     128[roadmap]
     129stats_provider = DefaultTicketGroupStatsProvider
     130
     131[search]
     132default_disabled_filters =
     133min_query_length = 3
     134
     135[sqlite]
     136extensions =
     137
     138[svn]
     139authz_file =
     140authz_module_name =
     141
     142[ticket]
     143allowed_empty_fields = milestone,version
     144default_cc =
     145default_component =
     146default_description =
     147default_keywords =
     148default_milestone =
     149default_owner = < default >
     150default_priority = major
     151default_resolution = fixed
     152default_severity =
     153default_summary =
     154default_type = defect
     155default_version =
     156max_comment_size = 262144
     157max_description_size = 262144
     158max_summary_size = 262144
     159preserve_newlines = default
     160restrict_owner = disabled
     161workflow = ConfigurableTicketWorkflow
    30162
    31163[ticket-workflow]
    32164accept = new,assigned,accepted,reopened -> accepted
     
    51183resolve.operations = set_resolution
    52184resolve.permissions = TICKET_MODIFY
    53185
     186[timeline]
     187abbreviated_messages = enabled
     188changeset_collapse_events = disabled
     189changeset_long_messages = disabled
     190changeset_show_files = 0
     191default_daysback = 30
     192max_daysback = 90
     193newticket_formatter = oneliner
     194ticket_show_component = disabled
     195ticket_show_details = disabled
     196
    54197[trac]
     198auth_cookie_lifetime = 0
     199auth_cookie_path =
     200auto_preview_timeout = 2.0
     201auto_reload = disabled
     202backup_dir = db
     203base_url =
     204check_auth_ip = disabled
    55205database = sqlite:db/trac.db
     206debug_sql = disabled
     207default_charset = utf-8
     208default_date_format =
     209default_dateinfo_format = relative
     210default_handler = WikiModule
     211default_language =
     212default_timezone =
     213genshi_cache_size = 128
     214htdocs_location =
     215ignore_auth_case = disabled
     216jquery_location =
     217jquery_ui_location =
     218jquery_ui_theme_location =
     219never_obfuscate_mailto = disabled
     220permission_policies = ReadonlyWikiPolicy,DefaultPermissionPolicy,LegacyAttachmentPolicy
     221permission_store = DefaultPermissionStore
     222request_filters =
     223resizable_textareas = enabled
     224secure_cookies = disabled
     225show_email_addresses = disabled
     226show_ip_addresses = disabled
     227timeout = 20
     228use_base_url_for_redirect = disabled
     229use_chunked_encoding = disabled
     230use_xsendfile = disabled
     231wiki_toolbars = enabled
     232xsendfile_header = X-Sendfile
     233
     234[versioncontrol]
     235allowed_repository_dir_prefixes =
     236default_repository_type = svn
     237
     238[wiki]
     239default_edit_area_height = 20
     240ignore_missing_pages = disabled
     241max_size = 262144
     242render_unsafe_content = disabled
     243safe_schemes = cvs,file,ftp,git,irc,http,https,news,sftp,smb,ssh,svn,svn+ssh
     244split_page_names = disabled

Attachments (0)

Change History (4)

comment:1 by Ryan J Ollos, 9 years ago

I also noticed that the following documentation may be inaccurate:

initenv [<projectname> <db> [<repostype> <repospath>]]

    Create and initialize a new environment

    If no arguments are given, then the required parameters are requested
    interactively.

    One or more optional arguments --inherit=PATH can be used to specify the
    "[inherit] file" option at environment creation time, so that only the
    options not already specified in one of the global configuration files are
    written to the conf/trac.ini file of the newly created environment.
    Relative paths are resolved relative to the "conf" directory of the new
    environment.

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.

comment:2 by Ryan J Ollos, 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 Ryan J Ollos, 9 years ago

Milestone: next-dev-1.1.xnext-major-releases
Type: defectenhancement

in reply to:  1 comment:4 by Ryan J Ollos, 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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


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