Error obtaining porevious_revision for file in renamed directory

Bug #1015281 reported by Martin von Gagern on 2012-06-19
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Trac-Bzr
Medium
Martin von Gagern

Bug Description

The BzrVersionedNode.get_content_revision method of a file will correspond to the version in which its content was last modified. That value will, via the BzrVersionedNode constructor, end up in the created_rev property. There it is picked up by trac.versioncontrol.web_ui.browser.process_request and fed back to BzrRepository.previous_rev as a rev-path pair.

If a directory is renamed (e.g. as a consequence of a bzr split), and a file within said directory is not modified afterwards, then the browser will encounter an error generating the links to the previous and next revision. This is because the path of the node is invalid for the revision at which its content last changed.

The proper solution would probably be adopting svn semantics: a file changes when its content OR its path changes. However, that information is costly to compute, so there probably won't be an easy fix for this soon.

Related branches

Martin von Gagern (gagern) wrote :

Please check wit current trunk.

Changed in trac-bzr:
assignee: nobody → Martin von Gagern (gagern)
importance: Undecided → Medium
status: New → Fix Committed
Annakan (annakan) wrote :

Ok you have now achieved officially godlike status and a place in my own, admirably small, personal pantheon. And as a force of good.

Short version : it works !

I'll keep using it in test for a few days but thanks for the support and investigation and your patch for what might appear as a corner case. You really did save the day.

I am not sure buying a pizza and a beer is really a way to thank people unless you count "killing them by junk food" a thank :) but if you want it, it is yours :D, Just point me to the pizza+beer fund :D

Thanks a lot again.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers