Show More
@@ -211,6 +211,10 b' class ReposController(BaseController):' | |||||
211 | self.__load_defaults() |
|
211 | self.__load_defaults() | |
212 | repo_model = RepoModel() |
|
212 | repo_model = RepoModel() | |
213 | changed_name = repo_name |
|
213 | changed_name = repo_name | |
|
214 | #override the choices with extracted revisions ! | |||
|
215 | choices, c.landing_revs = ScmModel().get_repo_landing_revs(repo_name) | |||
|
216 | c.landing_revs_choices = choices | |||
|
217 | ||||
214 | _form = RepoForm(edit=True, old_data={'repo_name': repo_name}, |
|
218 | _form = RepoForm(edit=True, old_data={'repo_name': repo_name}, | |
215 | repo_groups=c.repo_groups_choices, |
|
219 | repo_groups=c.repo_groups_choices, | |
216 | landing_revs=c.landing_revs_choices)() |
|
220 | landing_revs=c.landing_revs_choices)() |
@@ -180,12 +180,12 b' class SummaryController(BaseRepoControll' | |||||
180 | if c.enable_downloads: |
|
180 | if c.enable_downloads: | |
181 | c.download_options = self._get_download_links(c.rhodecode_repo) |
|
181 | c.download_options = self._get_download_links(c.rhodecode_repo) | |
182 |
|
182 | |||
183 |
c.readme_data, c.readme_file = |
|
183 | c.readme_data, c.readme_file = \ | |
184 | c.rhodecode_db_repo.repo_name, c.rhodecode_repo |
|
184 | self.__get_readme_data(c.rhodecode_db_repo) | |
185 | ) |
|
|||
186 | return render('summary/summary.html') |
|
185 | return render('summary/summary.html') | |
187 |
|
186 | |||
188 |
def __get_readme_data(self, |
|
187 | def __get_readme_data(self, db_repo): | |
|
188 | repo_name = db_repo.repo_name | |||
189 |
|
189 | |||
190 | @cache_region('long_term') |
|
190 | @cache_region('long_term') | |
191 | def _get_readme_from_cache(key): |
|
191 | def _get_readme_from_cache(key): | |
@@ -193,7 +193,8 b' class SummaryController(BaseRepoControll' | |||||
193 | readme_file = None |
|
193 | readme_file = None | |
194 | log.debug('Fetching readme file') |
|
194 | log.debug('Fetching readme file') | |
195 | try: |
|
195 | try: | |
196 | cs = repo.get_changeset() # fetches TIP |
|
196 | # get's the landing revision! or tip if fails | |
|
197 | cs = db_repo.get_landing_changeset() | |||
197 | renderer = MarkupRenderer() |
|
198 | renderer = MarkupRenderer() | |
198 | for f in README_FILES: |
|
199 | for f in README_FILES: | |
199 | try: |
|
200 | try: |
@@ -777,6 +777,13 b' class Repository(Base, BaseModel):' | |||||
777 | def get_changeset(self, rev=None): |
|
777 | def get_changeset(self, rev=None): | |
778 | return get_changeset_safe(self.scm_instance, rev) |
|
778 | return get_changeset_safe(self.scm_instance, rev) | |
779 |
|
779 | |||
|
780 | def get_landing_changeset(self): | |||
|
781 | """ | |||
|
782 | Returns landing changeset, or if that doesn't exist returns the tip | |||
|
783 | """ | |||
|
784 | cs = self.get_changeset(self.landing_rev) or self.get_changeset() | |||
|
785 | return cs | |||
|
786 | ||||
780 | @property |
|
787 | @property | |
781 | def tip(self): |
|
788 | def tip(self): | |
782 | return self.get_changeset('tip') |
|
789 | return self.get_changeset('tip') |
@@ -226,7 +226,7 b'' | |||||
226 |
|
226 | |||
227 | %if c.readme_data: |
|
227 | %if c.readme_data: | |
228 | <div id="readme" class="box header-pos-fix" style="background-color: #FAFAFA"> |
|
228 | <div id="readme" class="box header-pos-fix" style="background-color: #FAFAFA"> | |
229 | <div id="readme" class="title"> |
|
229 | <div id="readme" class="title" title="${_("Readme file at revision '%s'" % c.rhodecode_db_repo.landing_rev)}"> | |
230 | <div class="breadcrumbs"><a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a></div> |
|
230 | <div class="breadcrumbs"><a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a></div> | |
231 | </div> |
|
231 | </div> | |
232 | <div id="readme" class="readme"> |
|
232 | <div id="readme" class="readme"> |
General Comments 0
You need to be logged in to leave comments.
Login now