~loggerhead-team/loggerhead/experimental

« back to all changes in this revision

Viewing changes to loggerhead/controllers/inventory_ui.py

  • Committer: John Arbash Meinel
  • Date: 2011-04-11 14:55:55 UTC
  • mfrom: (419.2.26 loggerhead)
  • Revision ID: john@arbash-meinel.com-20110411145555-7xflzcipb32kuknh
Merge trunk into the history-db branch.

We had to disable the mainline tests, because they were monkey-patching
a parameter that we have removed. We need to figure out a way to
do a similar test.

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
43
43
 
44
44
    template_path = 'loggerhead.templates.inventory'
45
45
 
46
 
    def get_filelist(self, inv, path, sort_type):
 
46
    def get_filelist(self, inv, path, sort_type, revno_url):
47
47
        """
48
48
        return the list of all files (and their attributes) within a given
49
49
        path subtree.
56
56
        dir_ie = inv[file_id]
57
57
        file_list = []
58
58
 
 
59
        if dir_ie.kind != 'directory':
 
60
            raise HTTPMovedPermanently(self._branch.context_url(['/view', revno_url, path]))
 
61
 
59
62
        revid_set = set()
60
63
 
61
64
        for filename, entry in dir_ie.children.iteritems():
148
151
 
149
152
            # Create breadcrumb trail for the path within the branch
150
153
            branch_breadcrumbs = util.branch_breadcrumbs(path, rev_tree, 'files')
151
 
            filelist = self.get_filelist(rev_tree.inventory, path, sort_type)
 
154
            filelist = self.get_filelist(rev_tree.inventory, path, sort_type, revno_url)
152
155
        else:
153
156
            start_revid = None
154
157
            change = None