Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

#7636 closed enhancement (fixed)

trac-admin should allow editing of "trac.ini"

Reported by: sebastian@… 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)

7636-console.py-r7451.patch (1.9 KB ) - added by sebastian@… 16 years ago.
Patch for "admin/console.py" against Trac 0.11.1

Download all attachments as: .zip

Change History (8)

comment:1 by sebastian@…, 16 years ago

Milestone: 0.11.2

I've implemented the feature and attached the patch. This works for me.

by sebastian@…, 16 years ago

Attachment: 7636-console.py-r7451.patch added

Patch for "admin/console.py" against Trac 0.11.1

comment:2 by ebray, 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 Remy Blank, 16 years ago

Keywords: patch added
Milestone: 0.11.20.12
Owner: set to Remy Blank

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 a trac-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 sebastian@…, 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 Christian Boos, 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:6 by Remy Blank, 16 years ago

Ok, I'm convinced ;-) I'll put this into my pipeline.

comment:7 by Remy Blank, 16 years ago

Resolution: fixed
Status: newclosed

Patch applied to trunk in [7557], thanks!

  • In addition to config set and config remove, I also added config 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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank 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.