|
a/Allura/allura/controllers/repository.py |
|
b/Allura/allura/controllers/repository.py |
|
... |
|
... |
212 |
return dict(built_tree=json.dumps(sorted_commits),
|
212 |
return dict(built_tree=json.dumps(sorted_commits),
|
213 |
next_column=next_column,
|
213 |
next_column=next_column,
|
214 |
max_row=len(all_commits),
|
214 |
max_row=len(all_commits),
|
215 |
status='ready')
|
215 |
status='ready')
|
216 |
|
216 |
|
|
|
217 |
class RepoRestController(RepoRootController):
|
|
|
218 |
@expose('json:')
|
|
|
219 |
def index(self, **kw):
|
|
|
220 |
all_commits = c.app.repo._impl.new_commits(all_commits=True)
|
|
|
221 |
return dict(commit_count=len(all_commits))
|
|
|
222 |
|
|
|
223 |
@expose('json:')
|
|
|
224 |
def commits(self, **kw):
|
|
|
225 |
page_size = 25
|
|
|
226 |
offset = (int(kw.get('page',1)) * page_size) - page_size
|
|
|
227 |
revisions = c.app.repo.log(offset=offset, limit=page_size)
|
|
|
228 |
|
|
|
229 |
return dict(
|
|
|
230 |
commits=[
|
|
|
231 |
dict(
|
|
|
232 |
parents=[dict(id=p) for p in commit.parent_ids],
|
|
|
233 |
author=dict(
|
|
|
234 |
name=commit.authored.name,
|
|
|
235 |
email=commit.authored.email,
|
|
|
236 |
),
|
|
|
237 |
url=commit.url(),
|
|
|
238 |
id=commit.object_id,
|
|
|
239 |
committed_date=commit.committed.date,
|
|
|
240 |
authored_date=commit.authored.date,
|
|
|
241 |
message=commit.message,
|
|
|
242 |
tree=commit.tree.object_id,
|
|
|
243 |
committer=dict(
|
|
|
244 |
name=commit.committed.name,
|
|
|
245 |
email=commit.committed.email,
|
|
|
246 |
),
|
|
|
247 |
)
|
|
|
248 |
for commit in revisions
|
|
|
249 |
])
|
|
|
250 |
|
217 |
class MergeRequestsController(object):
|
251 |
class MergeRequestsController(object):
|
218 |
mr_filter=SCMMergeRequestFilterWidget()
|
252 |
mr_filter=SCMMergeRequestFilterWidget()
|
219 |
|
253 |
|
220 |
@expose('jinja:allura:templates/repo/merge_requests.html')
|
254 |
@expose('jinja:allura:templates/repo/merge_requests.html')
|
221 |
@validate(mr_filter)
|
255 |
@validate(mr_filter)
|