Ticket #6676 (closed defect: fixed)
Opened 4 years ago
Last modified 4 years ago
TracMercurial: Comparing two revisions appears to be unimplemented
| Reported by: | anonymous | Owned by: | cboos |
|---|---|---|---|
| Priority: | normal | Milestone: | not applicable |
| Component: | plugin/mercurial | Version: | 0.10.4 |
| Severity: | normal | Keywords: | |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
Description (last modified by cboos) (diff)
With Trac 10.4 (installed on a Fedora 8 system via yum) and the TracMercurial plugin taken from the repository head, trying to compare two revisions in the revision log using "View Changes" results in an error:
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 406, in dispatch_request
dispatcher.dispatch(req)
File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 237, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/lib/python2.5/site-packages/trac/versioncontrol/web_ui/changeset.py", line 254, in process_request
diff_args, diff_options)
File "/usr/lib/python2.5/site-packages/trac/versioncontrol/web_ui/changeset.py", line 479, in _render_html
for old_node, new_node, kind, change in get_changes():
File "/usr/lib/python2.5/site-packages/trac/versioncontrol/web_ui/changeset.py", line 366, in get_changes
for d in repos.get_changes(**diff):
File "/usr/lib/python2.5/site-packages/trac/versioncontrol/api.py", line 282, in get_changes
raise !NotImplementedError
!NotImplementedError
What's puzzling about this is that Repository.get_changes is not overridden in the Mercurial plugin, so it appears this functionality could never have worked at all. But I assume that's not true or the diffs on the TracMercurial page couldn't have been produced. Any clues?
Attachments
Change History
comment:1 Changed 4 years ago by cboos
- Component changed from version control to plugin/mercurial
- Description modified (diff)
- Resolution set to worksforme
- Status changed from new to closed
- Version set to 0.10.4
Changed 4 years ago by edgimar
- Attachment diff_backport.patch added
patch to make diff'ing work for trac 0.10.4
comment:2 Changed 4 years ago by edgimar
- Resolution worksforme deleted
- Status changed from closed to reopened
patch attached - please commit it. Thanks.
comment:3 Changed 4 years ago by cboos
- Milestone set to not applicable
Ok, I take your word that this backport will work for 0.10.x, but I won't test it or support it myself.
comment:4 Changed 4 years ago by cboos
- Resolution set to fixed
- Status changed from reopened to closed
Patch applied in r7355, thanks!
I however restored the def sync(): pass method that you removed, as I think it can still be needed (Trac 0.10.3 IIRC).



This is not implemented for source:sandbox/mercurial-plugin, but it is for source:sandbox/mercurial-plugin-0.11, i.e. the version of the plugin adapted to 0.11. It should be possible to backport the changes, so if you feel like contributing a patch for that, please do.
Btw, the Repository.get_changes() method is only used for comparing two arbitrary paths and/or revs, not for replaying the changes for a given changeset, which is a special case.