~bzr/loggerhead/daily-ppa

« back to all changes in this revision

Viewing changes to loggerhead/controllers/inventory_ui.py

  • Committer: Max Bowsher
  • Date: 2011-03-17 08:33:16 UTC
  • mfrom: (182.150.20 trunk-rich)
  • Revision ID: maxb@f2s.com-20110317083316-n5nq18tsaaxkskut
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import posixpath
23
23
import urllib
24
24
 
25
 
from paste.httpexceptions import HTTPNotFound
 
25
from paste.httpexceptions import HTTPNotFound, HTTPMovedPermanently
26
26
 
27
27
from bzrlib import errors
28
28
from bzrlib.revision import is_null as is_null_rev
45
45
 
46
46
    template_path = 'loggerhead.templates.inventory'
47
47
 
48
 
    def get_filelist(self, inv, path, sort_type):
 
48
    def get_filelist(self, inv, path, sort_type, revno_url):
49
49
        """
50
50
        return the list of all files (and their attributes) within a given
51
51
        path subtree.
58
58
        dir_ie = inv[file_id]
59
59
        file_list = []
60
60
 
 
61
        if dir_ie.kind != 'directory':
 
62
            raise HTTPMovedPermanently(self._branch.context_url(['/view', revno_url, path]))
 
63
 
61
64
        revid_set = set()
62
65
 
63
66
        for filename, entry in dir_ie.children.iteritems():
150
153
 
151
154
            # Create breadcrumb trail for the path within the branch
152
155
            branch_breadcrumbs = util.branch_breadcrumbs(path, rev_tree, 'files')
153
 
            filelist = self.get_filelist(rev_tree.inventory, path, sort_type)
 
156
            filelist = self.get_filelist(rev_tree.inventory, path, sort_type, revno_url)
154
157
        else:
155
158
            start_revid = None
156
159
            change = None