Opened 16 years ago
Closed 16 years ago
#7636 closed enhancement (fixed)
trac-admin should allow editing of "trac.ini"
Reported by: | Owned by: | Remy Blank | |
---|---|---|---|
Priority: | normal | Milestone: | 0.12 |
Component: | admin/console | Version: | 0.11.1 |
Severity: | normal | Keywords: | patch |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
It would be nice if one was able to edit the trac.ini
file with trac-admin
. Commands could be look like this:
config set <section> <option> <value> -- Set the value for the given option in "trac.ini" config remove <section> <option> -- Remove the specified option from "trac.ini"
This would, of course, only affect the trac.ini
of the administrated project (i.e. not a global trac.ini
).
Attachments (1)
Change History (8)
comment:1 by , 16 years ago
Milestone: | → 0.11.2 |
---|
by , 16 years ago
Attachment: | 7636-console.py-r7451.patch added |
---|
Patch for "admin/console.py" against Trac 0.11.1
comment:2 by , 16 years ago
Looks good to me. I had a patch similar to this a long time ago but never remembered to submit it. Story of my life I guess.
comment:3 by , 16 years ago
Keywords: | patch added |
---|---|
Milestone: | 0.11.2 → 0.12 |
Owner: | set to |
The patch looks good. However, I have two comments:
- Is this functionality really useful? Isn't it easier to edit
trac.ini
than to enter atrac-admin
command? Or in other words, what is the use case that is better served by a command than by direct editing? - As this adds new functionality, it would only be considered for 0.12.
comment:4 by , 16 years ago
I need this patch to administrate multiple Trac projects at once. This way I can change project specific settings (like paths or names) using a bash script and don't have to edit all Trac.ini files on my own.
comment:5 by , 16 years ago
Right, I was writing the following at the same time :-)
I think scripting is the use case here. Doing automated changes using trac-admin set/remove seems more robust then parsing/changing the trac.ini file (if you want to be precise, you have first to locate the section, then the entry, so it can't be done with a trivial sed
expression).
comment:7 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch applied to trunk in [7557], thanks!
- In addition to
config set
andconfig remove
, I also addedconfig get
to print the value of an option. - Command completion works for all
config
commands, for the config section and the option name. - Added 3 test cases for the
config
commands.
I've implemented the feature and attached the patch. This works for me.