Edgewall Software

Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#11346 closed defect (fixed)

The TracLinks [1,3:4] does not show the correct range of revisions — at Version 4

Reported by: Ryan J Ollos Owned by: Jun Omae
Priority: normal Milestone: 0.12.6
Component: version control/log view Version: 1.0-stable
Severity: normal Keywords: traclinks
Cc: Branch:
Release Notes:

Fix log: link with revision ranges included oldest wrongly showing HEAD revision.

API Changes:
Internal Changes:

Description

[2,4:5] and [2,4-5] are correct, however [1,4:5] and [1,4-5] show r1 and the range HEAD revision through rHEAD - n + 4, where n is the number from the preferences form Show at most n revisions per page.

Change History (4)

comment:1 by Jun Omae, 11 years ago

Milestone: next-stable-1.0.x1.0.2
Owner: set to Jun Omae
Status: newassigned

[1-2] has the same issue.

Proposed changes are the following patch and functional tests will be added later. Also, 0.12-stable have the same issue. I'll backport.

  • trac/versioncontrol/web_ui/log.py

    diff --git a/trac/versioncontrol/web_ui/log.py b/trac/versioncontrol/web_ui/log.py
    index 374d84d..8898919 100644
    a b class LogModule(Component):  
    147147                                if rev != nrev: # no, we need a separator
    148148                                    yield (np, nrev, None)
    149149                            yield node_history[0]
    150                         prevpath = node_history[-1][0] # follow copy
    151                         b = repos.previous_rev(rev)
    152150                        if len(node_history) > 1:
    153151                            expected_next_item = node_history[-1]
     152                            prevpath = expected_next_item[0]  # follow copy
     153                            b = expected_next_item[1]
    154154                        else:
    155155                            expected_next_item = None
     156                            break  # no more older revisions
    156157                if expected_next_item:
    157158                    yield (expected_next_item[0], expected_next_item[1], None)
    158159        else:

comment:2 by Ryan J Ollos, 11 years ago

It looks good, thanks for fixing it! At least for the cases I tested, it looks like the break is the primary fix for the issue, and the other two changes are refactoring / optimization.

comment:3 by Jun Omae, 11 years ago

Thanks for the feedback! log:jomae.git:ticket11346_0.12.6dev includes functional tests. I'll push it to 0.12-stable branch and merge into 1.0-stable and trunk.

comment:4 by Jun Omae, 11 years ago

Milestone: 1.0.20.12.6
Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed it to 0.12-stable in [12220] and merged to 1.0-stable and trunk in [12221,12222].

Note: See TracTickets for help on using tickets.