##// END OF EJS Templates
changelog: rename changelog to commits pages
marcink -
r3742:0d621dfb new-ui
parent child Browse files
Show More
@@ -469,7 +469,7 b' class HomeView(BaseAppView):'
469 469 _query=query_modifier())
470 470 }
471 471
472 if repo_context in ['commit', 'changelog']:
472 if repo_context in ['commit', 'commits']:
473 473 queries.extend([commit_qry, file_qry])
474 474 elif repo_context in ['files', 'summary']:
475 475 queries.extend([file_qry, commit_qry])
@@ -509,7 +509,7 b' class HomeView(BaseAppView):'
509 509 _query=query_modifier())
510 510 }
511 511
512 if repo_context in ['commit', 'changelog']:
512 if repo_context in ['commit', 'commits']:
513 513 queries.extend([commit_qry, file_qry])
514 514 elif repo_context in ['files', 'summary']:
515 515 queries.extend([file_qry, commit_qry])
@@ -153,7 +153,7 b' class JournalView(BaseAppView):'
153 153 desc = action_extra()
154 154 _url = h.route_url('home')
155 155 if entry.repository is not None:
156 _url = h.route_url('repo_changelog',
156 _url = h.route_url('repo_commits',
157 157 repo_name=entry.repository.repo_name)
158 158
159 159 feed.add_item(
@@ -199,7 +199,7 b' class JournalView(BaseAppView):'
199 199 desc = action_extra()
200 200 _url = h.route_url('home')
201 201 if entry.repository is not None:
202 _url = h.route_url('repo_changelog',
202 _url = h.route_url('repo_commits',
203 203 repo_name=entry.repository.repo_name)
204 204
205 205 feed.add_item(
@@ -193,19 +193,27 b' def includeme(config):'
193 193 name='repo_stats',
194 194 pattern='/{repo_name:.*?[^/]}/repo_stats/{commit_id}', repo_route=True)
195 195
196 # Changelog
196 # Commits
197 config.add_route(
198 name='repo_commits',
199 pattern='/{repo_name:.*?[^/]}/commits', repo_route=True)
200 config.add_route(
201 name='repo_commits_file',
202 pattern='/{repo_name:.*?[^/]}/commits/{commit_id}/{f_path:.*}', repo_route=True)
203 config.add_route(
204 name='repo_commits_elements',
205 pattern='/{repo_name:.*?[^/]}/commits_elements', repo_route=True)
206 config.add_route(
207 name='repo_commits_elements_file',
208 pattern='/{repo_name:.*?[^/]}/commits_elements/{commit_id}/{f_path:.*}', repo_route=True)
209
210 # Changelog (old deprecated name for commits page)
197 211 config.add_route(
198 212 name='repo_changelog',
199 213 pattern='/{repo_name:.*?[^/]}/changelog', repo_route=True)
200 214 config.add_route(
201 215 name='repo_changelog_file',
202 216 pattern='/{repo_name:.*?[^/]}/changelog/{commit_id}/{f_path:.*}', repo_route=True)
203 config.add_route(
204 name='repo_changelog_elements',
205 pattern='/{repo_name:.*?[^/]}/changelog_elements', repo_route=True)
206 config.add_route(
207 name='repo_changelog_elements_file',
208 pattern='/{repo_name:.*?[^/]}/changelog_elements/{commit_id}/{f_path:.*}', repo_route=True)
209 217
210 218 # Compare
211 219 config.add_route(
@@ -32,9 +32,10 b' def route_path(name, params=None, **kwar'
32 32 import urllib
33 33
34 34 base_url = {
35 'repo_changelog':'/{repo_name}/changelog',
36 'repo_changelog_file':'/{repo_name}/changelog/{commit_id}/{f_path}',
37 'repo_changelog_elements':'/{repo_name}/changelog_elements',
35 'repo_changelog': '/{repo_name}/changelog',
36 'repo_commits': '/{repo_name}/commits',
37 'repo_commits_file': '/{repo_name}/commits/{commit_id}/{f_path}',
38 'repo_commits_elements': '/{repo_name}/commits_elements',
38 39 }[name].format(**kwargs)
39 40
40 41 if params:
@@ -42,8 +43,23 b' def route_path(name, params=None, **kwar'
42 43 return base_url
43 44
44 45
46 def assert_commits_on_page(response, indexes):
47 found_indexes = [int(idx) for idx in MATCH_HASH.findall(response.body)]
48 assert found_indexes == indexes
49
50
45 51 class TestChangelogController(TestController):
46 52
53 def test_commits_page(self, backend):
54 self.log_user()
55 response = self.app.get(
56 route_path('repo_commits', repo_name=backend.repo_name))
57
58 first_idx = -1
59 last_idx = -DEFAULT_CHANGELOG_SIZE
60 self.assert_commit_range_on_page(
61 response, first_idx, last_idx, backend)
62
47 63 def test_changelog(self, backend):
48 64 self.log_user()
49 65 response = self.app.get(
@@ -62,6 +78,14 b' class TestChangelogController(TestContro'
62 78 params=dict(branch=backend.default_branch_name)),
63 79 status=200)
64 80
81 @pytest.mark.backends("hg", "git")
82 def test_commits_filtered_by_branch(self, backend):
83 self.log_user()
84 self.app.get(
85 route_path('repo_commits', repo_name=backend.repo_name,
86 params=dict(branch=backend.default_branch_name)),
87 status=200)
88
65 89 @pytest.mark.backends("svn")
66 90 def test_changelog_filtered_by_branch_svn(self, autologin_user, backend):
67 91 repo = backend['svn-simple-layout']
@@ -70,27 +94,22 b' class TestChangelogController(TestContro'
70 94 params=dict(branch='trunk')),
71 95 status=200)
72 96
73 self.assert_commits_on_page(
74 response, indexes=[15, 12, 7, 3, 2, 1])
97 assert_commits_on_page(response, indexes=[15, 12, 7, 3, 2, 1])
75 98
76 def test_changelog_filtered_by_wrong_branch(self, backend):
99 def test_commits_filtered_by_wrong_branch(self, backend):
77 100 self.log_user()
78 101 branch = 'wrong-branch-name'
79 102 response = self.app.get(
80 route_path('repo_changelog', repo_name=backend.repo_name,
103 route_path('repo_commits', repo_name=backend.repo_name,
81 104 params=dict(branch=branch)),
82 105 status=302)
83 expected_url = '/{repo}/changelog/{branch}'.format(
106 expected_url = '/{repo}/commits/{branch}'.format(
84 107 repo=backend.repo_name, branch=branch)
85 108 assert expected_url in response.location
86 109 response = response.follow()
87 110 expected_warning = 'Branch {} is not found.'.format(branch)
88 111 assert expected_warning in response.body
89 112
90 def assert_commits_on_page(self, response, indexes):
91 found_indexes = [int(idx) for idx in MATCH_HASH.findall(response.body)]
92 assert found_indexes == indexes
93
94 113 @pytest.mark.xfail_backends("svn", reason="Depends on branch support")
95 114 def test_changelog_filtered_by_branch_with_merges(
96 115 self, autologin_user, backend):
@@ -112,21 +131,20 b' class TestChangelogController(TestContro'
112 131 status=200)
113 132
114 133 @pytest.mark.backends("hg")
115 def test_changelog_closed_branches(self, autologin_user, backend):
134 def test_commits_closed_branches(self, autologin_user, backend):
116 135 repo = backend['closed_branch']
117 136 response = self.app.get(
118 route_path('repo_changelog', repo_name=repo.repo_name,
137 route_path('repo_commits', repo_name=repo.repo_name,
119 138 params=dict(branch='experimental')),
120 139 status=200)
121 140
122 self.assert_commits_on_page(
123 response, indexes=[3, 1])
141 assert_commits_on_page(response, indexes=[3, 1])
124 142
125 143 def test_changelog_pagination(self, backend):
126 144 self.log_user()
127 145 # pagination, walk up to page 6
128 146 changelog_url = route_path(
129 'repo_changelog', repo_name=backend.repo_name)
147 'repo_commits', repo_name=backend.repo_name)
130 148
131 149 for page in range(1, 7):
132 150 response = self.app.get(changelog_url, {'page': page})
@@ -168,10 +186,10 b' class TestChangelogController(TestContro'
168 186 '/vcs/exceptions.py',
169 187 '//vcs/exceptions.py'
170 188 ])
171 def test_changelog_with_filenode(self, backend, test_path):
189 def test_commits_with_filenode(self, backend, test_path):
172 190 self.log_user()
173 191 response = self.app.get(
174 route_path('repo_changelog_file', repo_name=backend.repo_name,
192 route_path('repo_commits_file', repo_name=backend.repo_name,
175 193 commit_id='tip', f_path=test_path),
176 194 )
177 195
@@ -180,16 +198,16 b' class TestChangelogController(TestContro'
180 198 response.mustcontain('Added not implemented hg backend test case')
181 199 response.mustcontain('Added BaseChangeset class')
182 200
183 def test_changelog_with_filenode_that_is_dirnode(self, backend):
201 def test_commits_with_filenode_that_is_dirnode(self, backend):
184 202 self.log_user()
185 203 self.app.get(
186 route_path('repo_changelog_file', repo_name=backend.repo_name,
204 route_path('repo_commits_file', repo_name=backend.repo_name,
187 205 commit_id='tip', f_path='/tests'),
188 206 status=302)
189 207
190 def test_changelog_with_filenode_not_existing(self, backend):
208 def test_commits_with_filenode_not_existing(self, backend):
191 209 self.log_user()
192 210 self.app.get(
193 route_path('repo_changelog_file', repo_name=backend.repo_name,
211 route_path('repo_commits_file', repo_name=backend.repo_name,
194 212 commit_id='tip', f_path='wrong_path'),
195 213 status=302)
@@ -40,6 +40,8 b' def route_path(name, params=None, **kwar'
40 40 base_url = {
41 41 'repo_changelog': '/{repo_name}/changelog',
42 42 'repo_changelog_file': '/{repo_name}/changelog/{commit_id}/{f_path}',
43 'repo_commits': '/{repo_name}/changelog',
44 'repo_commits_file': '/{repo_name}/changelog/{commit_id}/{f_path}',
43 45 'pullrequest_show': '/{repo_name}/pull-request/{pull_request_id}',
44 46 'pullrequest_show_all': '/{repo_name}/pull-request',
45 47 'pullrequest_show_all_data': '/{repo_name}/pull-request-data',
@@ -998,11 +1000,11 b' class TestPullrequestsView(object):'
998 1000 assert len(target_children) == 1
999 1001
1000 1002 expected_origin_link = route_path(
1001 'repo_changelog',
1003 'repo_commits',
1002 1004 repo_name=pull_request.source_repo.scm_instance().name,
1003 1005 params=dict(branch='origin'))
1004 1006 expected_target_link = route_path(
1005 'repo_changelog',
1007 'repo_commits',
1006 1008 repo_name=pull_request.target_repo.scm_instance().name,
1007 1009 params=dict(branch='target'))
1008 1010 assert origin_children[0].attrib['href'] == expected_origin_link
@@ -113,7 +113,7 b' class RepoChangelogView(RepoAppView):'
113 113 h.flash('Branch {} is not found.'.format(h.escape(branch_name)),
114 114 category='warning')
115 115 redirect_url = h.route_path(
116 'repo_changelog_file', repo_name=repo_name,
116 'repo_commits_file', repo_name=repo_name,
117 117 commit_id=branch_name, f_path=f_path or '')
118 118 raise HTTPFound(redirect_url)
119 119
@@ -127,13 +127,13 b' class RepoChangelogView(RepoAppView):'
127 127 if f_path:
128 128 # changelog for file
129 129 return h.route_path(
130 'repo_changelog_file',
130 'repo_commits_file',
131 131 repo_name=c.rhodecode_db_repo.repo_name,
132 132 commit_id=commit_id, f_path=f_path,
133 133 _query=query_params)
134 134 else:
135 135 return h.route_path(
136 'repo_changelog',
136 'repo_commits',
137 137 repo_name=c.rhodecode_db_repo.repo_name, _query=query_params)
138 138
139 139 c.total_cs = len(collection)
@@ -171,11 +171,18 b' class RepoChangelogView(RepoAppView):'
171 171 @HasRepoPermissionAnyDecorator(
172 172 'repository.read', 'repository.write', 'repository.admin')
173 173 @view_config(
174 route_name='repo_commits', request_method='GET',
175 renderer='rhodecode:templates/commits/changelog.mako')
176 @view_config(
177 route_name='repo_commits_file', request_method='GET',
178 renderer='rhodecode:templates/commits/changelog.mako')
179 # old routes for backward compat
180 @view_config(
174 181 route_name='repo_changelog', request_method='GET',
175 renderer='rhodecode:templates/changelog/changelog.mako')
182 renderer='rhodecode:templates/commits/changelog.mako')
176 183 @view_config(
177 184 route_name='repo_changelog_file', request_method='GET',
178 renderer='rhodecode:templates/changelog/changelog.mako')
185 renderer='rhodecode:templates/commits/changelog.mako')
179 186 def repo_changelog(self):
180 187 c = self.load_default_context()
181 188
@@ -224,7 +231,7 b' class RepoChangelogView(RepoAppView):'
224 231 except RepositoryError as e:
225 232 h.flash(safe_str(e), category='warning')
226 233 redirect_url = h.route_path(
227 'repo_changelog', repo_name=self.db_repo_name)
234 'repo_commits', repo_name=self.db_repo_name)
228 235 raise HTTPFound(redirect_url)
229 236 collection = list(reversed(collection))
230 237 else:
@@ -246,14 +253,14 b' class RepoChangelogView(RepoAppView):'
246 253 log.exception(safe_str(e))
247 254 h.flash(safe_str(h.escape(e)), category='error')
248 255 raise HTTPFound(
249 h.route_path('repo_changelog', repo_name=self.db_repo_name))
256 h.route_path('repo_commits', repo_name=self.db_repo_name))
250 257
251 258 if partial_xhr or self.request.environ.get('HTTP_X_PJAX'):
252 259 # case when loading dynamic file history in file view
253 260 # loading from ajax, we don't want the first result, it's popped
254 261 # in the code above
255 262 html = render(
256 'rhodecode:templates/changelog/changelog_file_history.mako',
263 'rhodecode:templates/commits/changelog_file_history.mako',
257 264 self._get_template_context(c), self.request)
258 265 return Response(html)
259 266
@@ -271,14 +278,14 b' class RepoChangelogView(RepoAppView):'
271 278 @HasRepoPermissionAnyDecorator(
272 279 'repository.read', 'repository.write', 'repository.admin')
273 280 @view_config(
274 route_name='repo_changelog_elements', request_method=('GET', 'POST'),
275 renderer='rhodecode:templates/changelog/changelog_elements.mako',
281 route_name='repo_commits_elements', request_method=('GET', 'POST'),
282 renderer='rhodecode:templates/commits/changelog_elements.mako',
276 283 xhr=True)
277 284 @view_config(
278 route_name='repo_changelog_elements_file', request_method=('GET', 'POST'),
279 renderer='rhodecode:templates/changelog/changelog_elements.mako',
285 route_name='repo_commits_elements_file', request_method=('GET', 'POST'),
286 renderer='rhodecode:templates/commits/changelog_elements.mako',
280 287 xhr=True)
281 def repo_changelog_elements(self):
288 def repo_commits_elements(self):
282 289 c = self.load_default_context()
283 290 commit_id = self.request.matchdict.get('commit_id')
284 291 f_path = self._get_f_path(self.request.matchdict)
@@ -312,7 +319,7 b' class RepoChangelogView(RepoAppView):'
312 319 except (RepositoryError, CommitDoesNotExistError, Exception) as e:
313 320 log.exception(safe_str(e))
314 321 raise HTTPFound(
315 h.route_path('repo_changelog', repo_name=self.db_repo_name))
322 h.route_path('repo_commits', repo_name=self.db_repo_name))
316 323
317 324 collection = base_commit.get_path_history(
318 325 f_path, limit=hist_limit, pre_load=pre_load)
@@ -2061,7 +2061,8 b' def reviewer_as_json(*args, **kwargs):'
2061 2061 def get_repo_view_type(request):
2062 2062 route_name = request.matched_route.name
2063 2063 route_to_view_type = {
2064 'repo_changelog': 'changelog',
2064 'repo_changelog': 'commits',
2065 'repo_commits': 'commits',
2065 2066 'repo_files': 'files',
2066 2067 'repo_summary': 'summary',
2067 2068 'repo_commit': 'commit'
@@ -478,11 +478,11 b' class MercurialRepository(BaseRepository'
478 478 ``end`` could not be found.
479 479 """
480 480 # actually we should check now if it's not an empty repo
481 branch_ancestors = False
482 481 if self.is_empty():
483 482 raise EmptyRepositoryError("There are no commits yet")
484 483 self._validate_branch_name(branch_name)
485 484
485 branch_ancestors = False
486 486 if start_id is not None:
487 487 self._validate_commit_id(start_id)
488 488 c_start = self.get_commit(commit_id=start_id)
@@ -277,7 +277,7 b' class SubversionRepository(base.BaseRepo'
277 277 try:
278 278 commit_id = self.commit_ids[commit_idx]
279 279 except IndexError:
280 raise CommitDoesNotExistError
280 raise CommitDoesNotExistError('No commit with idx: {}'.format(commit_idx))
281 281
282 282 commit_id = self._sanitize_commit_id(commit_id)
283 283 commit = SubversionCommit(repository=self, commit_id=commit_id)
@@ -98,7 +98,7 b' function setRCMouseBindings(repoName, re'
98 98 });
99 99 Mousetrap.bind(['g c'], function(e) {
100 100 window.location = pyroutes.url(
101 'repo_changelog', {'repo_name': repoName});
101 'repo_commits', {'repo_name': repoName});
102 102 });
103 103 Mousetrap.bind(['g F'], function(e) {
104 104 window.location = pyroutes.url(
@@ -196,14 +196,17 b' function registerRCRoutes() {'
196 196 pyroutes.register('repo_files_edit_file', '/%(repo_name)s/edit_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
197 197 pyroutes.register('repo_files_update_file', '/%(repo_name)s/update_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
198 198 pyroutes.register('repo_files_add_file', '/%(repo_name)s/add_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
199 pyroutes.register('repo_files_upload_file', '/%(repo_name)s/upload_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
199 200 pyroutes.register('repo_files_create_file', '/%(repo_name)s/create_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
200 201 pyroutes.register('repo_refs_data', '/%(repo_name)s/refs-data', ['repo_name']);
201 202 pyroutes.register('repo_refs_changelog_data', '/%(repo_name)s/refs-data-changelog', ['repo_name']);
202 203 pyroutes.register('repo_stats', '/%(repo_name)s/repo_stats/%(commit_id)s', ['repo_name', 'commit_id']);
204 pyroutes.register('repo_commits', '/%(repo_name)s/commits', ['repo_name']);
205 pyroutes.register('repo_commits_file', '/%(repo_name)s/commits/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
206 pyroutes.register('repo_commits_elements', '/%(repo_name)s/commits_elements', ['repo_name']);
207 pyroutes.register('repo_commits_elements_file', '/%(repo_name)s/commits_elements/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
203 208 pyroutes.register('repo_changelog', '/%(repo_name)s/changelog', ['repo_name']);
204 209 pyroutes.register('repo_changelog_file', '/%(repo_name)s/changelog/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
205 pyroutes.register('repo_changelog_elements', '/%(repo_name)s/changelog_elements', ['repo_name']);
206 pyroutes.register('repo_changelog_elements_file', '/%(repo_name)s/changelog_elements/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
207 210 pyroutes.register('repo_compare_select', '/%(repo_name)s/compare', ['repo_name']);
208 211 pyroutes.register('repo_compare', '/%(repo_name)s/compare/%(source_ref_type)s@%(source_ref)s...%(target_ref_type)s@%(target_ref)s', ['repo_name', 'source_ref_type', 'source_ref', 'target_ref_type', 'target_ref']);
209 212 pyroutes.register('tags_home', '/%(repo_name)s/tags', ['repo_name']);
@@ -112,10 +112,10 b' var CommitsController = function () {'
112 112 }
113 113
114 114 if (urlData['commit_id'] && urlData['f_path']) {
115 return pyroutes.url('repo_changelog_elements_file', urlData);
115 return pyroutes.url('repo_commits_elements_file', urlData);
116 116 }
117 117 else {
118 return pyroutes.url('repo_changelog_elements', urlData);
118 return pyroutes.url('repo_commits_elements', urlData);
119 119 }
120 120
121 121 };
@@ -283,7 +283,7 b''
283 283
284 284 <ul id="context-pages" class="navigation horizontal-list">
285 285 <li class="${is_active('summary')}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li>
286 <li class="${is_active('changelog')}"><a class="menulink" href="${h.route_path('repo_changelog', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li>
286 <li class="${is_active('commits')}"><a class="menulink" href="${h.route_path('repo_commits', repo_name=c.repo_name)}"><div class="menulabel">${_('Commits')}</div></a></li>
287 287 <li class="${is_active('files')}"><a class="menulink" href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.rhodecode_db_repo.landing_rev[1], f_path='')}"><div class="menulabel">${_('Files')}</div></a></li>
288 288 <li class="${is_active('compare')}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li>
289 289
@@ -15,7 +15,7 b''
15 15 </%def>
16 16
17 17 <%def name="menu_bar_subnav()">
18 ${self.repo_menu(active='changelog')}
18 ${self.repo_menu(active='commits')}
19 19 </%def>
20 20
21 21 <%def name="main()">
@@ -25,7 +25,7 b''
25 25 </%def>
26 26
27 27 <%def name="menu_bar_subnav()">
28 ${self.repo_menu(active='changelog')}
28 ${self.repo_menu(active='commits')}
29 29 </%def>
30 30
31 31 <%def name="main()">
@@ -23,7 +23,7 b''
23 23 </%def>
24 24
25 25 <%def name="menu_bar_subnav()">
26 ${self.repo_menu(active='changelog')}
26 ${self.repo_menu(active='commits')}
27 27 </%def>
28 28
29 29 <%def name="main()">
@@ -241,7 +241,7 b''
241 241
242 242 $("#clear_filter").on("click", function() {
243 243 var filter = {'repo_name': '${c.repo_name}'};
244 window.location = pyroutes.url('repo_changelog', filter);
244 window.location = pyroutes.url('repo_commits', filter);
245 245 });
246 246
247 247 $("#branch_filter").select2({
@@ -295,7 +295,7 b''
295 295 else if (data.type == 'book'){
296 296 filter["bookmark"] = selected;
297 297 }
298 window.location = pyroutes.url('repo_changelog', filter);
298 window.location = pyroutes.url('repo_commits', filter);
299 299 });
300 300
301 301 commitsController = new CommitsController();
@@ -102,7 +102,7 b''
102 102 ## branch
103 103 %if commit.branch:
104 104 <span class="tag branchtag" title="${h.tooltip(_('Branch %s') % commit.branch)}">
105 <a href="${h.route_path('repo_changelog',repo_name=c.repo_name,_query=dict(branch=commit.branch))}"><i class="icon-code-fork"></i>${h.shorter(commit.branch)}</a>
105 <a href="${h.route_path('repo_commits',repo_name=c.repo_name,_query=dict(branch=commit.branch))}"><i class="icon-code-fork"></i>${h.shorter(commit.branch)}</a>
106 106 </span>
107 107 %endif
108 108
@@ -42,7 +42,7 b''
42 42 %endfor
43 43 <tr>
44 44 <td colspan="6">
45 <a id="file_history_overview_full" href="${h.route_path('repo_changelog_file',repo_name=c.repo_name, commit_id=c.commit_id, f_path=c.f_path)}">
45 <a id="file_history_overview_full" href="${h.route_path('repo_commits_file',repo_name=c.repo_name, commit_id=c.commit_id, f_path=c.f_path)}">
46 46 ${_('Show Full History')}
47 47 </a>
48 48 </td>
@@ -48,8 +48,8 b''
48 48 </a>
49 49 </li>
50 50 <li>
51 <a title="${_('Changelog')}" href="${h.route_path('repo_changelog',repo_name=repo_name)}">
52 <span>${_('Changelog')}</span>
51 <a title="${_('Commits')}" href="${h.route_path('repo_commits',repo_name=repo_name)}">
52 <span>${_('Commits')}</span>
53 53 </a>
54 54 </li>
55 55 <li>
@@ -641,7 +641,7 b' File Edit'
641 641 <span class="item">1.2 KiB</span>
642 642 <span class="item last">text/x-python</span>
643 643 <div class="buttons">
644 <a class="btn btn-mini" href="/example/changelog/80ead1899f50a894889e19ffeb49c9cebf5bf045/rhodecode/websetup.py">
644 <a class="btn btn-mini" href="/example/commits/80ead1899f50a894889e19ffeb49c9cebf5bf045/rhodecode/websetup.py">
645 645 <i class="icon-time"></i> history
646 646 </a>
647 647
@@ -182,7 +182,7 b''
182 182 if (path.indexOf("#") >= 0) {
183 183 path = path.slice(0, path.indexOf("#"));
184 184 }
185 var url = pyroutes.url('repo_changelog_file',
185 var url = pyroutes.url('repo_commits_file',
186 186 {'repo_name': templateContext.repo_name,
187 187 'commit_id': state.commit_id, 'f_path': path, 'limit': 6});
188 188 $('#file_history_container').show();
@@ -48,7 +48,7 b''
48 48 <span class="item">${h.format_byte_size_binary(c.file.size)}</span>
49 49 <span class="item last">${c.file.mimetype}</span>
50 50 <div class="buttons">
51 <a class="btn btn-mini" href="${h.route_path('repo_changelog_file',repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path=c.f_path)}">
51 <a class="btn btn-mini" href="${h.route_path('repo_commits_file',repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path=c.f_path)}">
52 52 <i class="icon-time"></i> ${_('history')}
53 53 </a>
54 54
@@ -72,7 +72,7 b''
72 72 ## branch link is only valid if it is a branch
73 73 <span class="tag">
74 74 %if c.pull_request.source_ref_parts.type == 'branch':
75 <a href="${h.route_path('repo_changelog', repo_name=c.pull_request.source_repo.repo_name, _query=dict(branch=c.pull_request.source_ref_parts.name))}">${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}</a>
75 <a href="${h.route_path('repo_commits', repo_name=c.pull_request.source_repo.repo_name, _query=dict(branch=c.pull_request.source_ref_parts.name))}">${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}</a>
76 76 %else:
77 77 ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}
78 78 %endif
@@ -108,7 +108,7 b''
108 108 ## branch link is only valid if it is a branch
109 109 <span class="tag">
110 110 %if c.pull_request.target_ref_parts.type == 'branch':
111 <a href="${h.route_path('repo_changelog', repo_name=c.pull_request.target_repo.repo_name, _query=dict(branch=c.pull_request.target_ref_parts.name))}">${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}</a>
111 <a href="${h.route_path('repo_commits', repo_name=c.pull_request.target_repo.repo_name, _query=dict(branch=c.pull_request.target_ref_parts.name))}">${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}</a>
112 112 %else:
113 113 ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}
114 114 %endif
@@ -82,7 +82,7 b''
82 82
83 83 <div class="pull-right">
84 84 <div class="buttons">
85 <a id="file_history_overview_full" href="${h.route_path('repo_changelog_file',repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path',''))}">
85 <a id="file_history_overview_full" href="${h.route_path('repo_commits_file',repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path',''))}">
86 86 ${_('Show Full History')}
87 87 </a>
88 88 | ${h.link_to(_('Annotation'), h.route_path('repo_files:annotated', repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
@@ -119,7 +119,7 b''
119 119 <span>0</span> ${_('Commits')}
120 120 % endif
121 121 % else:
122 <a href="${h.route_path('repo_changelog', repo_name=c.repo_name)}">
122 <a href="${h.route_path('repo_commits', repo_name=c.repo_name)}">
123 123 <i class="icon-tag"></i>
124 124 % if commit_rev == 1:
125 125 <span>${commit_rev}</span> ${_('Commit')}
@@ -76,7 +76,7 b''
76 76 ## branch
77 77 %if cs.branch:
78 78 <span class="branchtag tag" title="${h.tooltip(_('Branch %s') % cs.branch)}">
79 <a href="${h.route_path('repo_changelog',repo_name=c.repo_name,_query=dict(branch=cs.branch))}"><i class="icon-code-fork"></i>${h.shorter(cs.branch)}</a>
79 <a href="${h.route_path('repo_commits',repo_name=c.repo_name,_query=dict(branch=cs.branch))}"><i class="icon-code-fork"></i>${h.shorter(cs.branch)}</a>
80 80 </span>
81 81 %endif
82 82 </div>
@@ -35,7 +35,7 b' from rhodecode.tests import get_new_dir'
35 35 from rhodecode.tests.vcs.conftest import BackendTestMixin
36 36
37 37
38 class TestBaseChangeset:
38 class TestBaseChangeset(object):
39 39
40 40 def test_is_deprecated(self):
41 41 from rhodecode.lib.vcs.backends.base import BaseChangeset
@@ -176,6 +176,10 b' class TestCommitsInNonEmptyRepo(BackendT'
176 176 commit_indexes = [c.idx for c in commits]
177 177 assert commit_indexes == [1, 2, 3, 7, 12, 15]
178 178
179 def test_get_commit_by_index(self):
180 for idx in [1, 2, 3, 4]:
181 assert idx == self.repo.get_commit(commit_idx=idx).idx
182
179 183 def test_get_commit_by_branch(self):
180 184 for branch, commit_id in self.repo.branches.iteritems():
181 185 assert commit_id == self.repo.get_commit(branch).raw_id
General Comments 0
You need to be logged in to leave comments. Login now