Ticket #7254 (closed enhancement: fixed)
Opened 4 years ago
Last modified 2 years ago
Add navigation (prev/next revision) to repo browser
| Reported by: | res@… | Owned by: | rblank |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.12 |
| Component: | version control/browser | Version: | 0.11rc1 |
| Severity: | normal | Keywords: | |
| Cc: | info@…, ryano@… | ||
| Release Notes: | |||
| API Changes: | |||
Description
This adds two navigation links to the source browser to quickly get to the previous or next revision of a file.
Attachments
Change History
Changed 4 years ago by res@…
- Attachment trac-rev-navigate.diff added
comment:2 Changed 3 years ago by cboos
- Milestone changed from 0.13 to 0.12
comment:3 Changed 2 years ago by Thijs Triemstra <info@…>
- Cc info@… added
comment:4 Changed 2 years ago by Ryan Ollos <ryano@…>
- Cc ryano@… added
Changed 2 years ago by rblank
- Attachment 7254-previous-next-rev-r8709.patch added
Improved version of the first patch.
comment:6 Changed 2 years ago by rblank
The patch above is an improved version of the first patch:
- Use node.rev to determine previous and next revision, instead of rev_or_latest.
- Don't display a "Next Revision" link when already at the latest revision.
- Added arrows.
However, it has the following caveats (that were already present in the original patch):
- Using repos.prev_rev() and repo.next_rev() doesn't work well for directories, so the links are only shown for files. Making it work for directories would require using the same logic as in the revision log, and even then, would only allow going back in time, not forward (the same as in the log). I feel this is too much complication for the added value.
- repos.prev_rev() doesn't follow copies. I could probably add some logic for that, but I'm not sure it's worth the effort.
Thoughts?
comment:7 follow-up: ↓ 8 Changed 2 years ago by cboos
I think we can live with the proposed implementation and the caveats above (the TracBrowser interface can always be improved later, especially when the rev navigation logic itself gets improved).
But can we have a way to see:
<- Previous Revision | Revision Log | Next Revision ->
so that it matches what we have when looking at specific versions of wiki pages or tickets?
comment:8 in reply to: ↑ 7 Changed 2 years ago by rblank
Replying to cboos:
But can we have a way to see:
Sure, actually that's what the original patch was doing. I couldn't find a place where we had the same situation (previous and next links, and other links in-between), so I settled for keeping the links that are always present always at the same location (on the right). But better be consistent.
comment:9 Changed 2 years ago by rblank
Mmh, the wiki pages actually have the following:
<- Previous Version | View Latest Version | Next Version -> | Last Change
How about using prevnext_nav(), like we do for wiki pages? Patch coming up shortly.
Changed 2 years ago by rblank
- Attachment 7254-previous-next-rev-r8709.2.patch added
Improved version using prevnext_nav().
comment:10 Changed 2 years ago by rblank
- Resolution set to fixed
- Status changed from new to closed
Last patch applied in [8745], the navigation is consistent with wiki pages.
comment:11 Changed 2 years ago by Ryan Ollos <ryano@…>
Hello,
I was looking at the changes you made, and because you merged this into the trunk I was expecting that if I navigated to a file such as browser:trunk/trac/versioncontrol/web_ui/browser.py, I would be able to see the prev/latest/next revision links.
I was assuming that this Trac site was running off the trunk. Is that not the case?
- Ryan
comment:12 Changed 2 years ago by rblank
No, it's running 0.11-stable (r8631 at the moment).



Patch to add navigation for repo browser