Opened 9 years ago
Last modified 9 years ago
#11979 closed defect
Limit parameter in log view has off-by-one error — at Initial Version
Reported by: | Jun Omae | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.6 |
Component: | version control/log view | Version: | 0.12-stable |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
log:?rev=10 shows 10 commits but log:?rev=10&limit=10 shows 9 commits. The limit
parameter has off-by-one error.
-
trac/versioncontrol/web_ui/log.py
diff --git a/trac/versioncontrol/web_ui/log.py b/trac/versioncontrol/web_ui/log.py index 9e4d3cc..ed4e910 100644
a b class LogModule(Component): 256 256 '%(rev)s)', path=next_path, 257 257 rev=display_rev(next_rev))) 258 258 # only show fully 'limit' results, use `change == None` as a marker 259 info[-1]['change'] = None 259 if count > limit: 260 info[-1]['change'] = None 260 261 261 262 revisions = [i['rev'] for i in info] 262 263 changes = get_changes(repos, revisions, self.log)
I'll push it with unit tests later.
Note:
See TracTickets
for help on using tickets.