~zigarn/loggerhead/nested-branches

« back to all changes in this revision

Viewing changes to loggerhead/controllers/directory_ui.py

  • Committer: Alexandre Garnier
  • Date: 2009-06-30 20:27:26 UTC
  • Revision ID: zigouigoui.garnier@laposte.net-20090630202726-9y0m72zl9ybbpk7f
Better redirection on root and python < 2.5 compatibility

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
        current_dir = DirEntry('.', b)
113
113
 
114
114
        if b and not dirs:
115
 
            raise httpexceptions.HTTPMovedPermanently('files')
 
115
            url = self._name
 
116
            if self._name == '/':
 
117
                url = ''
 
118
            raise httpexceptions.HTTPMovedPermanently(url + '/files')
116
119
 
117
120
        # Create breadcrumb trail
118
121
        directory_breadcrumbs = util.directory_breadcrumbs(
131
134
    """
132
135
 
133
136
    def __init__(self, branch, history_callable):
 
137
        name = branch.friendly_name
 
138
        if not name.startswith('/'):
 
139
            name = '/'
134
140
        super(BranchDirectoryUI, self).__init__(
135
141
                branch._static_url_base,
136
142
                branch.branch.bzrdir.root_transport,
137
 
                branch.friendly_name if branch.friendly_name.startswith('/') else '/')
 
143
                name)