Merge lp:~twom/loggerhead/use-rev-not-file-rev into lp:loggerhead

Proposed by Tom Wardill
Status: Merged
Approved by: Tom Wardill
Approved revision: 505
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~twom/loggerhead/use-rev-not-file-rev
Merge into: lp:loggerhead
Diff against target: 14 lines (+1/-3)
1 file modified
loggerhead/controllers/view_ui.py (+1/-3)
To merge this branch: bzr merge lp:~twom/loggerhead/use-rev-not-file-rev
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+387105@code.launchpad.net

Commit message

Use current rev, not file rev

Description of the change

Looking up the file revision to get the tree doesn't work if the file is in a subdirectory that has moved.
Instead, use the revision that we've got from the URL to get the tree, then look up the file.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

I don't completely follow this, but I'm happy to give it a go and see if it works better in some of those corner cases.

review: Approve
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loggerhead/controllers/view_ui.py'
2--- loggerhead/controllers/view_ui.py 2020-07-08 16:57:56 +0000
3+++ loggerhead/controllers/view_ui.py 2020-07-09 08:53:02 +0000
4@@ -54,9 +54,7 @@
5 raise TypeError(path)
6 if not isinstance(revid, bytes):
7 raise TypeError(revid)
8- rev_tree = self._history.revision_tree(revid)
9- file_revid = rev_tree.get_file_revision(path)
10- return self._history._branch.repository.revision_tree(file_revid)
11+ return self._history._branch.repository.revision_tree(revid)
12
13 def text_lines(self, path, revid):
14 file_name = os.path.basename(path)

Subscribers

People subscribed via source and target branches