##// END OF EJS Templates
added tags, and branches to file history select box, fixed annotation changeset errors crash on wrongly given revions
marcink -
r774:c47152c5 beta
parent child Browse files
Show More
@@ -81,7 +81,6 b' class FilesController(BaseController):'
81 try:
81 try:
82 c.files_list = c.changeset.get_node(f_path)
82 c.files_list = c.changeset.get_node(f_path)
83 c.file_history = self._get_history(c.repo, c.files_list, f_path)
83 c.file_history = self._get_history(c.repo, c.files_list, f_path)
84
85 except RepositoryError, e:
84 except RepositoryError, e:
86 h.flash(str(e), category='warning')
85 h.flash(str(e), category='warning')
87 redirect(h.url('files_home', repo_name=repo_name, revision=revision))
86 redirect(h.url('files_home', repo_name=repo_name, revision=revision))
@@ -114,8 +113,14 b' class FilesController(BaseController):'
114 def annotate(self, repo_name, revision, f_path):
113 def annotate(self, repo_name, revision, f_path):
115 hg_model = ScmModel()
114 hg_model = ScmModel()
116 c.repo = hg_model.get_repo(c.repo_name)
115 c.repo = hg_model.get_repo(c.repo_name)
117 c.cs = c.repo.get_changeset(revision)
116
118 c.file = c.cs.get_node(f_path)
117 try:
118 c.cs = c.repo.get_changeset(revision)
119 c.file = c.cs.get_node(f_path)
120 except RepositoryError, e:
121 h.flash(str(e), category='warning')
122 redirect(h.url('files_home', repo_name=repo_name, revision=revision))
123
119 c.file_history = self._get_history(c.repo, c.file, f_path)
124 c.file_history = self._get_history(c.repo, c.file, f_path)
120
125
121 c.f_path = f_path
126 c.f_path = f_path
@@ -212,7 +217,31 b' class FilesController(BaseController):'
212 return []
217 return []
213 changesets = node.history
218 changesets = node.history
214 hist_l = []
219 hist_l = []
220
221 changesets_group = ([], _("Changesets"))
222 branches_group = ([], _("Branches"))
223 tags_group = ([], _("Tags"))
224
215 for chs in changesets:
225 for chs in changesets:
216 n_desc = 'r%s:%s' % (chs.revision, chs.short_id)
226 n_desc = 'r%s:%s' % (chs.revision, chs.short_id)
217 hist_l.append((chs.raw_id, n_desc,))
227 changesets_group[0].append((chs.raw_id, n_desc,))
228
229 hist_l.append(changesets_group)
230
231 for name, chs in c.repository_branches.items():
232 #chs = chs.split(':')[-1]
233 branches_group[0].append((chs, name),)
234 hist_l.append(branches_group)
235
236 for name, chs in c.repository_tags.items():
237 #chs = chs.split(':')[-1]
238 tags_group[0].append((chs, name),)
239 hist_l.append(tags_group)
240
218 return hist_l
241 return hist_l
242
243 # [
244 # ([("u1", "User1"), ("u2", "User2")], "Users"),
245 # ([("g1", "Group1"), ("g2", "Group2")], "Groups")
246 # ]
247
General Comments 0
You need to be logged in to leave comments. Login now