Edgewall Software

Ticket #7573 (new enhancement)

Opened 3 months ago

Last modified 3 months ago

base_url for many projects is painful

Reported by: doki_pen <doki_pen@…> Owned by: osimons
Priority: normal Milestone: 0.12
Component: general Version: 0.12dev
Severity: normal Keywords:
Cc:

Description

Setting the base_url in hundreds of ini files, and changing them with a hostname change is painful. I've attached a patch for a parent_base_url trac.ini setting that can be used in a parent trac.ini.

Attachments

parent_base_url-r7499.diff (1.7 KB) - added by doki_pen <doki_pen@…> 3 months ago.
Add a parent_base_url setting.

Change History

Changed 3 months ago by doki_pen <doki_pen@…>

Add a parent_base_url setting.

Changed 3 months ago by osimons

  • owner set to osimons

It would be useful, and it was also briefly raised by me on #5064 a while back.

As I see it, there are two alternatives:

  1. Like your patch introduce a new setting for 'parent'.
  2. Or, introduce substitusion in the original base_url so that you can write base_url = http://myhost/trac/$folder for instance.

Regardless, many places in Trac and not least external plugins and scripts make reference to the base_url setting, so I expect a fair amount of breakage for any change in setting or calculation (like the story with #5064). I need other devs to chime in with their opinion before anything gets committed.

Changed 3 months ago by doki_pen <doki_pen@…>

I originally tried using the interpolation feature in ConfigParser? to do something like this

# parent.trac.ini
[trac]
parent_base_url = http://myhost/trac
# trac.ini
[inherit]
file = parent.trac.ini

[trac]
base_url = %(parent_base_url)/myproject

But discovered that it doesn't work. The inheritance feature is implemented at a higher level then the interpolation feature. Perhaps this should work and the is what should be changed, but it seemed more difficult.

Changed 3 months ago by dave@…

Mightn't it be easier as environ?

Add/Change #7573 (base_url for many projects is painful)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change from osimons. Next status will be 'new'
The owner will change from osimons to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.