~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/controllers/revlog_ui.py

  • Committer: Danilo Segan
  • Date: 2011-09-02 10:22:52 UTC
  • mfrom: (455.1.2 bug-839395)
  • Revision ID: danilo@canonical.com-20110902102252-phc11upmjw8tz1mg
[r=jam][bug=839395] Do not crash when someone asks to look at per-revision changes for a file when file is not changed in a certain revision.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import urllib
 
2
 
 
3
from loggerhead.controllers import TemplatedBranchView
 
4
 
 
5
 
 
6
class RevLogUI(TemplatedBranchView):
 
7
 
 
8
    template_path = 'loggerhead.templates.revlog'
 
9
    supports_json = True
 
10
 
 
11
    def get_values(self, path, kwargs, headers):
 
12
        history = self._history
 
13
 
 
14
        revid = urllib.unquote(self.args[0])
 
15
 
 
16
        change = history.get_changes([revid])[0]
 
17
        file_changes = history.get_file_changes(change)
 
18
        history.add_branch_nicks(change)
 
19
 
 
20
        return {
 
21
            'entry': change,
 
22
            'file_changes': file_changes,
 
23
            'revid': revid,
 
24
        }