Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#4759 closed enhancement (fixed)

LOG_LIMIT -> runtime option?

Reported by: Sergei Haller <sergei@…> Owned by: Christian Boos
Priority: normal Milestone: 0.11
Component: version control/log view Version: devel
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

would it be possible to make LOG_LIMIT value in trac/versioncontrol/web_ui/log.py be configurable via conf/trac.ini

Attachments (3)

limit.patch (1.4 KB ) - added by Sergei Haller <sergei@…> 17 years ago.
limit.2.patch (1.4 KB ) - added by Sergei Haller <sergei@…> 17 years ago.
updated against svn r4781
loglim.patch (1.6 KB ) - added by Sergei Haller <sergei@…> 17 years ago.
that adds an option to trac.ini to adjust the default value for limit

Download all attachments as: .zip

Change History (13)

comment:1 by Sergei Haller <sergei@…>, 17 years ago

maybe LOG_LIMIT is not the right thing. I actually think, that LOG_LIMIT can stay where it is.

The actual reequest is to make the default number of revisions displayed in the revision log browser to be configurable. (at the moment it is the same as LOG_LIMIT)

comment:2 by Christian Boos, 17 years ago

Milestone: 0.12

IIRC, a "limit" parameter was originally part of the log preferences panel. Then, it was a bit redundant with the 'back to' parameter (in View log starting at ____ and back to ____).

Maybe this could be made a user configurable setting.

comment:3 by Sergei Haller <sergei@…>, 17 years ago

ehm yea, that was also my first impression. correct is that LOG_LIMIT is the macimal number of revisions to whow in revlog viewer. That is, wven if you enter you want 10000 back to 1, it will at most show LOG_LIMIT revisions at a time.

on the other hand, the same value is used for the default display. (i.e. when you first click on "rev log" without having entered anything in this update dialog)

but that's not urgent, as I have changed the value in the source. Just thought would be a good idea to make that configurable via trac.ini.

in reply to:  2 comment:4 by Sergei Haller <sergei@…>, 17 years ago

Replying to cboos:

IIRC, a "limit" parameter was originally part of the log preferences panel. Then, it was a bit redundant with the 'back to' parameter (in View log starting at ____ and back to ____).

voting to readd this (in 0.11?) again. It is not unusual to ask for revisions 10000 to 2 but showing at most 10 or 20 revisions (which might be e.g. 9001,9000,8992,6000,300,2 for a subdirectory or a single file)

attaching a patch.

by Sergei Haller <sergei@…>, 17 years ago

Attachment: limit.patch added

by Sergei Haller <sergei@…>, 17 years ago

Attachment: limit.2.patch added

updated against svn r4781

comment:5 by Sergei Haller <sergei@…>, 17 years ago

I just updated the patch. I'd really appreciate it if you could get it into the trunk.

I see that this is obviously redundant with the "back to" parameter, but only in the root of the svn project. In any subdirectory, or a particular file, these are really two different things.

Thanks in advance.

comment:6 by Christian Boos, 17 years ago

Milestone: 0.120.11
Resolution: fixed
Severity: normalminor
Status: newclosed

I liked the formulation Show at most n revisions, as expressed that way it's not redundant neither ambiguous with the back to parameter (it's even clearer, because previously if one specified from 2000 and back to 1000, one would only get the first 100 revisions, without that limit being explicitly mentioned anywhere).

Slightly adapted patch applied in r4788, thanks!

by Sergei Haller <sergei@…>, 17 years ago

Attachment: loglim.patch added

that adds an option to trac.ini to adjust the default value for limit

comment:7 by Christian Boos, 17 years ago

What would you think about:

  • trac/versioncontrol/web_ui/log.py

     
    1919import re
    2020import urllib
    2121
     22from trac.config import IntOption
    2223from trac.context import Context
    2324from trac.core import *
    2425from trac.perm import IPermissionRequestor
     
    3435                            Chrome
    3536from trac.wiki import IWikiSyntaxProvider, WikiParser
    3637
    37 LOG_LIMIT = 100
    38 
    3938class LogModule(Component):
    4039
    4140    implements(INavigationContributor, IPermissionRequestor, IRequestHandler,
    4241               IWikiSyntaxProvider)
    4342
     43    default_log_limit = IntOption('revisionlog', 'default_log_limit', 100,
     44        """Default value for the limit argument in the TracRevisionLog
     45        (''since 0.11'').""")
     46
    4447    # INavigationContributor methods
    4548
    4649    def get_active_navigation_item(self, req):
     
    7376        revs = req.args.get('revs', rev)
    7477        format = req.args.get('format')
    7578        verbose = req.args.get('verbose')
    76         limit = int(req.args.get('limit') or LOG_LIMIT)
     79        limit = int(req.args.get('limit') or self.default_log_limit)
    7780
    7881        repos = self.env.get_repository(req.authname)
    7982        normpath = repos.normalize_path(path)

instead?

I think it's better to keep that in the same module, plus it makes it more convenient to use the value (by using self.default_log_limit).

in reply to:  7 comment:8 by Sergei Haller <sergei@…>, 17 years ago

Replying to cboos:

What would you think about: ![…] instead?

I think it's better to keep that in the same module, plus ![…]

sure. would have done myself, but didn't feel like adding a new section to trac.ini

and of course I don't have as good overview over the code as you guys do

comment:9 by Christian Boos, 17 years ago

Ok, added in r4802.

comment:10 by Sergei Haller <sergei@…>, 17 years ago

cool. thanks

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.