~ubuntu-branches/debian/experimental/loggerhead/experimental

« back to all changes in this revision

Viewing changes to loggerhead/controllers/inventory_ui.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2011-06-02 14:11:55 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20110602141155-fqi99pe4rgw6wqt9
Tags: 1.18.1+bzr447-1
New upstream snapshot.

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