Edgewall Software
Modify

Opened 20 years ago

Closed 18 years ago

#1601 closed enhancement (fixed)

custom SVN properties in "browse source" section

Reported by: oliver@… Owned by: Christian Boos
Priority: normal Milestone: 0.11
Component: version control/browser Version: 0.8.1
Severity: normal Keywords: SVN property, browse source
Cc: pn@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

It would be nice to have the possibility to define custom SVN properties which has to be shown in the "browse source" section. For example I want to define a custom SVN property for the build system which has to be shown in the "browse source" section. The configuration of the SVN properties to be shown in the "browse source" could be part of the trac.ini configuration file.

This could be used for the new SVN 1.2 locking functionality too (svn:needs-lock SVN property).

Attachments (0)

Change History (10)

comment:1 by Matthew Good, 20 years ago

Severity: normalenhancement

comment:2 by Christian Boos, 19 years ago

Milestone: 0.9
Owner: changed from Jonas Borgström to Christian Boos
Status: newassigned

I'm interested in this one.

Configuration syntax could be similar to the one used for TracTicketsCustomFields

[browser-custom]

svn:executable = bool
svn:executable.order = 1
svn:executable.label = Exe
svn:executable.title = Executable bit

svn:needs-lock = bool
svn:needs-lock.order = 2
svn:needs-lock.label = L
svn:needs-lock.title = Locking Needed

trac:comment = wiki
trac:comment.order = 3
trac:comment.label = Comment
trac:comment.title = Short description for the path
...
  • A bool property would be rendered with a checkmark if its content is not empty,
  • A wiki property can contain arbitrary wiki markup
  • A text property renders as plain text

Even better, the types could be extensible, so that the rendering method could be adapted to each content. E.g.

class IPropertyRenderer(Interface):
  def get_property_renderers(self):
    """Return a list of (property_type,property_handler) pairs.

    `property_type` is the type associated to a property in the TracIni.

    `property_handler` is a method taking `(req,pname,pvalue)` as
    arguments and which returns some HTML for displaying the property's value
    """

The req argument could be used to adapt the rendering to the context (e.g. an image render could display a small size picture for the browser and a full size image for the changeset view…)

comment:3 by Christian Boos, 19 years ago

Milestone: 1.0

Note that property renderers could also be used for fixing #1896:

[browser-custom]
svk:merge = hidden
class HiddenPropertyRenderer(Component):
  implements IPropertyRenderer

  def get_property_renderers(self):
    return ('hidden', self.render)

  def render(self,req,pname,pvalue):
    return ''

comment:4 by anonymous, 19 years ago

I think it would be very useful to be able to show properties in general, and not just the ones listed in the ini file. Of course some protection is needed if a non-printable value is set

Also showing revision properties for changesets is very useful too. For our development we are looking at applying a code-review-log to the revision properties, so we can later see the comments of the code review.

comment:5 by Matthew Good, 19 years ago

to anonymous: In the trunk SVN properties are already displayed if they're available. This ticket is about providing a way to display certain properties in a more descriptive manner. The default behavior would be to display the available properties as plain-text if not otherwise specified.

Revision properties are an interesting suggestion though.

comment:6 by Christian Boos, 19 years ago

Status: assignednew

(changing the status, as I've not actually started to work on that yet)

comment:7 by Christian Boos, 19 years ago

Milestone: 1.00.11

comment:8 by Christian Boos, 18 years ago

Status: newassigned

I've started to work on this one: source:sandbox/property-renderers-tmp

So far, this addresses the #2340 issue and #3002. I plan to rework #2545 as well to use the IPropertyRenderer. Finally, I'll add support for displaying properties in columns, as originally requested in this ticket.

comment:9 by anonymous, 18 years ago

Cc: pn@… added

comment:10 by Christian Boos, 18 years ago

Resolution: fixed
Status: assignedclosed

Implemented in r4653 (IPropertyRenderer). See also r4654 for an example (support for svn:externals and svn:needs-lock properties).

There are two built-in property renderers. The first, DefaultPropertyRenderer, simply checks for the properties listed in the [browser] hide_properties configuration entry, and will render as text any property not listed there. Multi-lines properties will be correctly rendered.

The second, WikiPropertyRenderer, checks for properties listed in either the [browser] wiki_properties or the [browser] oneliner_properties configuration entries, and will wiki format the property, either as html or as single line output, respectively.

Modify Ticket

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