##// END OF EJS Templates
fixed error when trying to make download on empty repository
marcink -
r945:05b59c48 beta
parent child Browse files
Show More
@@ -27,7 +27,7 b' fixes'
27 - fixed file browser bug, when switching into given form revision the url was
27 - fixed file browser bug, when switching into given form revision the url was
28 not changing
28 not changing
29 - fixed propagation to error controller on simplehg and simplegit middlewares
29 - fixed propagation to error controller on simplehg and simplegit middlewares
30
30 - fixed error when trying to make a download on empty repository
31
31
32
32
33 1.1.2 (**2011-01-12**)
33 1.1.2 (**2011-01-12**)
@@ -154,16 +154,16 b' class FilesController(BaseController):'
154 '.tar.gz': ('application/x-tar', 'tgz'),
154 '.tar.gz': ('application/x-tar', 'tgz'),
155 '.zip': ('application/zip', 'zip'),
155 '.zip': ('application/zip', 'zip'),
156 }
156 }
157
157
158 fileformat = None
158 fileformat = None
159 revision = None
159 revision = None
160
160
161 for ext in archive_specs.keys():
161 for ext in archive_specs.keys():
162 archive_spec = fname.split(ext)
162 archive_spec = fname.split(ext)
163 if len(archive_spec) == 2:
163 if len(archive_spec) == 2:
164 fileformat = archive_spec[1] or ext
164 fileformat = archive_spec[1] or ext
165 revision = archive_spec[0]
165 revision = archive_spec[0]
166
166
167 if not archive_specs.has_key(fileformat):
167 if not archive_specs.has_key(fileformat):
168 return _('Unknown archive type')
168 return _('Unknown archive type')
169
169
@@ -173,6 +173,8 b' class FilesController(BaseController):'
173 repo.get_changeset(revision)
173 repo.get_changeset(revision)
174 except ChangesetDoesNotExistError:
174 except ChangesetDoesNotExistError:
175 return _('Unknown revision %s') % revision
175 return _('Unknown revision %s') % revision
176 except EmptyRepositoryError:
177 return _('Empty repository')
176
178
177 archive = tempfile.TemporaryFile()
179 archive = tempfile.TemporaryFile()
178 localrepo = repo.repo
180 localrepo = repo.repo
@@ -128,17 +128,20 b''
128 <label>${_('Download')}:</label>
128 <label>${_('Download')}:</label>
129 </div>
129 </div>
130 <div class="input-short">
130 <div class="input-short">
131
131 %if len(c.repo_info.revisions) == 0:
132 ${h.select('download_options',c.repo_info.get_changeset().raw_id,c.download_options)}
132 ${_('There are no downloads yet')}
133 %for cnt,archive in enumerate(c.repo_info._get_archives()):
133 %else:
134 %if cnt >=1:
134 ${h.select('download_options',c.repo_info.get_changeset().raw_id,c.download_options)}
135 |
135 %for cnt,archive in enumerate(c.repo_info._get_archives()):
136 %endif
136 %if cnt >=1:
137 <span class="tooltip" title="${_('Download %s as %s') %('tip',archive['type'])}"
137 |
138 id="${archive['type']+'_link'}">${h.link_to(archive['type'],
138 %endif
139 h.url('files_archive_home',repo_name=c.repo_info.name,
139 <span class="tooltip" title="${_('Download %s as %s') %('tip',archive['type'])}"
140 fname='tip'+archive['extension']),class_="archive_icon")}</span>
140 id="${archive['type']+'_link'}">${h.link_to(archive['type'],
141 %endfor
141 h.url('files_archive_home',repo_name=c.repo_info.name,
142 fname='tip'+archive['extension']),class_="archive_icon")}</span>
143 %endfor
144 %endif
142 </div>
145 </div>
143 </div>
146 </div>
144
147
@@ -268,12 +271,11 b''
268 </div>
271 </div>
269
272
270 <div class="table">
273 <div class="table">
271
272 %if c.no_data:
274 %if c.no_data:
273 <div style="padding:0 10px 10px 15px;font-size: 1.2em;">${c.no_data_msg}
275 <div style="padding:0 10px 10px 15px;font-size: 1.2em;">${c.no_data_msg}
274 %if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
276 %if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
275 [${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name))}]
277 [${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name))}]
276 %endif
278 %endif
277 </div>
279 </div>
278 %endif:
280 %endif:
279 <div id="commit_history" style="width:460px;height:300px;float:left"></div>
281 <div id="commit_history" style="width:460px;height:300px;float:left"></div>
General Comments 0
You need to be logged in to leave comments. Login now