Modify ↓
Opened 10 years ago
Closed 10 years ago
#11979 closed defect (fixed)
Limit parameter in log view has off-by-one error
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.6 |
Component: | version control/log view | Version: | 0.12-stable |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fix off-by-one error in |
||
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.
Attachments (0)
Change History (2)
comment:1 by , 10 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:2 by , 10 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
The below patch is incomplete. Reworked and proposed changes in jomae.git@t11979.