#12641 closed defect (fixed)
components section is not completed in "config set" of trac-admin
| Reported by: | Jun Omae | Owned by: | Ryan J Ollos |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.2.3 |
| Component: | admin/console | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: |
Empty configuration sections are listed in command completion output of |
||
| API Changes: | |||
| Internal Changes: | |||
Description
In config subcommands, existent sections and options are only completed. Fresh trac.ini doesn't have [components] section. Then, the components section is not completed.
I think defined sections and options should be completed in config set command even if not existent.
Attachments (0)
Change History (7)
comment:1 by , 8 years ago
| Milestone: | next-stable-1.2.x → 1.2.3 |
|---|---|
| Owner: | set to |
| Status: | new → assigned |
follow-ups: 4 6 comment:3 by , 8 years ago
I tried. Sections and options which are not declared with ConfigSection and Option in trac.ini are not listed.
Trac [/var/trac/1.2-sqlite]> config set foo-section bar-option 42
Trac [/var/trac/1.2-sqlite]> config remove foo
^ Enter TAB key but none is completed
Also, svn:externals section is declared in svn_prop.py but not listed.
follow-up: 5 comment:4 by , 8 years ago
Replying to Jun Omae:
Also,
svn:externalssection is declared in svn_prop.py but not listed.
I find that it is listed when the component is enabled. Is the component enabled in your environment?
Trac [/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/env]> config get components tracopt.versioncontrol.* enabled Trac [/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/env]> config get attachment metanav roadmap browser milestone search changeset milestone-groups sqlite components mimeviewer svn git notification svn:externals gitweb-repositories notification-subscriber ticket header_logo project ticket-custom inherit pygments-lexer ticket-workflow intertrac query timeline interwiki report trac logging repositories versioncontrol mainnav revisionlog wiki
comment:5 by , 8 years ago
Replying to Ryan J Ollos:
Replying to Jun Omae:
Also,
svn:externalssection is declared in svn_prop.py but not listed.I find that it is listed when the component is enabled. Is the component enabled in your environment?
Ah. Missing tracopt.versioncontrol.* = enabled in my environment. The svn:externals is listed after enabling the components. Thanks.
comment:6 by , 8 years ago
Replying to Jun Omae:
I tried. Sections and options which are not declared with
ConfigSectionandOptionin trac.ini are not listed.Trac [/var/trac/1.2-sqlite]> config set foo-section bar-option 42 Trac [/var/trac/1.2-sqlite]> config remove foo ^ Enter TAB key but none is completed
I reconsidered how to solve the issue: [be1bf0044/rjollos.git].
In most cases we don't want the empty sections to be returned from Configuration.sections(). I added an optional parameter empty, which defaults to False and determines whether entries from the ConfigSection registry are included.
comment:7 by , 8 years ago
| Release Notes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
Committed to 1.2-stable in r16231, merged to trunk in [16232,16234].
I noticed the output was sorted without an explicit sort action in console.py. I tried debugging in the code and could not see where the output was being formatted. My best guess is that it's happening in readline.
Trac [/Users/rjollos/Documents/Workspace/trac-dev/tracenvs/proj-1.2]> config get account-manager mainnav spam-filter attachment metanav sqlite authz_policy milestone svn autowikify milestone-groups svn:externals browser mimeviewer ticket changeset multiselectfield ticket-custom childtickets notification ticket-workflow components notification-subscriber ticketstats discussion plantuml timeline extra-permissions project trac git pygments-lexer versioncontrol gitweb-repositories query wiki header_logo report wiki-notification hg repositories wikiextras inherit revisionlog wikiextras-custom-phrases intertrac roadmap wikiextras-smileys interwiki search wikiextras-symbols logging simple-multi-project
I noticed that the output is not sorted when using pypi:pyreadline:
Trac [C:\Users\Ryan Ollos\My Documents\Workspace\proj-1.2]> config set
wiki notification search
changeset gitweb-repositories interwiki
sqlite attachment logging
authz_policy mimeviewer ticket-custom
roadmap milestone-groups trac
header_logo mainnav repositories
intertrac timeline inherit
versioncontrol extra-permissions project
svn:externals metanav pygments-lexer
query milestone components
notification-subscriber report ticket-workflow
revisionlog ticket browser
git svn
I tried sorting the values returned by ConfigurationAdmin._complete_config, but it didn't seem to make a difference.
Anyway, I don't think it's too important, but if anyone determines the cause we can handle it in a new ticket.



How about this fix?:
trac/config.py