Mercurial > kallithea
annotate rhodecode/controllers/changelog.py @ 1693:60249224be04 beta
fix for api key lookup, reuse same function in user model
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 17 Nov 2011 18:52:48 +0200 |
parents | 833f9dec0a06 |
children | cf51bbfb120e |
rev | line source |
---|---|
861
fd2ea6ceadc8
updated docs on every controller
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
1 # -*- coding: utf-8 -*- |
fd2ea6ceadc8
updated docs on every controller
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
2 """ |
fd2ea6ceadc8
updated docs on every controller
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
3 rhodecode.controllers.changelog |
fd2ea6ceadc8
updated docs on every controller
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
fd2ea6ceadc8
updated docs on every controller
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
5 |
fd2ea6ceadc8
updated docs on every controller
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
6 changelog controller for rhodecode |
1130
1cecc7db3106
fixed some limits in changesets and changelogs
Marcin Kuzminski <marcin@python-works.com>
parents:
1109
diff
changeset
|
7 |
861
fd2ea6ceadc8
updated docs on every controller
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
8 :created_on: Apr 21, 2010 |
fd2ea6ceadc8
updated docs on every controller
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
9 :author: marcink |
1203
6832ef664673
source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents:
1130
diff
changeset
|
10 :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com> |
861
fd2ea6ceadc8
updated docs on every controller
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
11 :license: GPLv3, see COPYING for more details. |
fd2ea6ceadc8
updated docs on every controller
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
12 """ |
1206
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
13 # This program is free software: you can redistribute it and/or modify |
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
14 # it under the terms of the GNU General Public License as published by |
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
15 # the Free Software Foundation, either version 3 of the License, or |
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
16 # (at your option) any later version. |
1203
6832ef664673
source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents:
1130
diff
changeset
|
17 # |
252
3782a6d698af
licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents:
245
diff
changeset
|
18 # This program is distributed in the hope that it will be useful, |
3782a6d698af
licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents:
245
diff
changeset
|
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3782a6d698af
licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents:
245
diff
changeset
|
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3782a6d698af
licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents:
245
diff
changeset
|
21 # GNU General Public License for more details. |
1203
6832ef664673
source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents:
1130
diff
changeset
|
22 # |
252
3782a6d698af
licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents:
245
diff
changeset
|
23 # You should have received a copy of the GNU General Public License |
1206
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
24 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
861
fd2ea6ceadc8
updated docs on every controller
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
25 |
fd2ea6ceadc8
updated docs on every controller
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
26 import logging |
1656
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
27 import traceback |
592
0a48c1ec04fc
#37 fixed json imports for python2.5
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
28 |
1412
5f878edbee00
Bumped Mercurial to 1.9 and fixed graphlog for this version
Marcin Kuzminski <marcin@python-works.com>
parents:
1331
diff
changeset
|
29 from mercurial import graphmod |
1656
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
30 from pylons import request, url, session, tmpl_context as c |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
31 from pylons.controllers.util import redirect |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
32 from pylons.i18n.translation import _ |
861
fd2ea6ceadc8
updated docs on every controller
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
33 |
1656
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
34 import rhodecode.lib.helpers as h |
547
1e757ac98988
renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
361
diff
changeset
|
35 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator |
1045
3fc9183e05dd
another major codes rewrite:
Marcin Kuzminski <marcin@python-works.com>
parents:
1038
diff
changeset
|
36 from rhodecode.lib.base import BaseRepoController, render |
1098
91ddd4db4614
Added dedicated repo pager to support reversed new way slicing method of vcs and get_changesets method
Marcin Kuzminski <marcin@python-works.com>
parents:
1083
diff
changeset
|
37 from rhodecode.lib.helpers import RepoPage |
1514
87ec80c280bb
fixed issues with python2.5
Marcin Kuzminski <marcin@python-works.com>
parents:
1434
diff
changeset
|
38 from rhodecode.lib.compat import json |
861
fd2ea6ceadc8
updated docs on every controller
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
39 |
1656
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
40 from vcs.exceptions import RepositoryError, ChangesetError, \ |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
41 ChangesetDoesNotExistError,BranchDoesNotExistError |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
42 |
318
fdf9f6ee5217
Implemented permissions into hg app, secured admin controllers, templates and repository specific controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
291
diff
changeset
|
43 log = logging.getLogger(__name__) |
93
aec4c0071cb3
added empty controllers for branches tags files graph, routing and test for them
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
44 |
1212 | 45 |
1045
3fc9183e05dd
another major codes rewrite:
Marcin Kuzminski <marcin@python-works.com>
parents:
1038
diff
changeset
|
46 class ChangelogController(BaseRepoController): |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
47 |
192
f191f99f59c9
full changelog caching, secured changelog with LoginRequired, some minor changes in graph
Marcin Kuzminski <marcin@python-works.com>
parents:
142
diff
changeset
|
48 @LoginRequired() |
318
fdf9f6ee5217
Implemented permissions into hg app, secured admin controllers, templates and repository specific controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
291
diff
changeset
|
49 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
50 'repository.admin') |
93
aec4c0071cb3
added empty controllers for branches tags files graph, routing and test for them
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
51 def __before__(self): |
192
f191f99f59c9
full changelog caching, secured changelog with LoginRequired, some minor changes in graph
Marcin Kuzminski <marcin@python-works.com>
parents:
142
diff
changeset
|
52 super(ChangelogController, self).__before__() |
1130
1cecc7db3106
fixed some limits in changesets and changelogs
Marcin Kuzminski <marcin@python-works.com>
parents:
1109
diff
changeset
|
53 c.affected_files_cut_off = 60 |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
54 |
93
aec4c0071cb3
added empty controllers for branches tags files graph, routing and test for them
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
55 def index(self): |
213 | 56 limit = 100 |
57 default = 20 | |
192
f191f99f59c9
full changelog caching, secured changelog with LoginRequired, some minor changes in graph
Marcin Kuzminski <marcin@python-works.com>
parents:
142
diff
changeset
|
58 if request.params.get('size'): |
211
a3a7c3e03b76
version bump. Bugfix when changelog parameter was not an int. Added limit for 100 changelogs to view at once.
Marcin Kuzminski <marcin@python-works.com>
parents:
196
diff
changeset
|
59 try: |
a3a7c3e03b76
version bump. Bugfix when changelog parameter was not an int. Added limit for 100 changelogs to view at once.
Marcin Kuzminski <marcin@python-works.com>
parents:
196
diff
changeset
|
60 int_size = int(request.params.get('size')) |
a3a7c3e03b76
version bump. Bugfix when changelog parameter was not an int. Added limit for 100 changelogs to view at once.
Marcin Kuzminski <marcin@python-works.com>
parents:
196
diff
changeset
|
61 except ValueError: |
a3a7c3e03b76
version bump. Bugfix when changelog parameter was not an int. Added limit for 100 changelogs to view at once.
Marcin Kuzminski <marcin@python-works.com>
parents:
196
diff
changeset
|
62 int_size = default |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
63 int_size = int_size if int_size <= limit else limit |
211
a3a7c3e03b76
version bump. Bugfix when changelog parameter was not an int. Added limit for 100 changelogs to view at once.
Marcin Kuzminski <marcin@python-works.com>
parents:
196
diff
changeset
|
64 c.size = int_size |
192
f191f99f59c9
full changelog caching, secured changelog with LoginRequired, some minor changes in graph
Marcin Kuzminski <marcin@python-works.com>
parents:
142
diff
changeset
|
65 session['changelog_size'] = c.size |
f191f99f59c9
full changelog caching, secured changelog with LoginRequired, some minor changes in graph
Marcin Kuzminski <marcin@python-works.com>
parents:
142
diff
changeset
|
66 session.save() |
142
f7218849798a
Changeg graph to changelog, and changelog to shortlog
Marcin Kuzminski <marcin@python-works.com>
parents:
127
diff
changeset
|
67 else: |
282
237470e64bb8
switched filters into webhelpers for easy of usage.
Marcin Kuzminski <marcin@python-works.com>
parents:
276
diff
changeset
|
68 c.size = int(session.get('changelog_size', default)) |
192
f191f99f59c9
full changelog caching, secured changelog with LoginRequired, some minor changes in graph
Marcin Kuzminski <marcin@python-works.com>
parents:
142
diff
changeset
|
69 |
f191f99f59c9
full changelog caching, secured changelog with LoginRequired, some minor changes in graph
Marcin Kuzminski <marcin@python-works.com>
parents:
142
diff
changeset
|
70 p = int(request.params.get('page', 1)) |
1106
5cbaeda8ec6f
fixed percentage indicator of build stats,added branch filter to changelog controller
Marcin Kuzminski <marcin@python-works.com>
parents:
1098
diff
changeset
|
71 branch_name = request.params.get('branch', None) |
1656
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
72 try: |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
73 if branch_name: |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
74 collection = [z for z in |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
75 c.rhodecode_repo.get_changesets(start=0, |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
76 branch_name=branch_name)] |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
77 c.total_cs = len(collection) |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
78 else: |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
79 collection = list(c.rhodecode_repo) |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
80 c.total_cs = len(c.rhodecode_repo) |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
81 |
1656
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
82 |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
83 c.pagination = RepoPage(collection, page=p, item_count=c.total_cs, |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
84 items_per_page=c.size, branch=branch_name) |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
85 except (RepositoryError, ChangesetDoesNotExistError, Exception), e: |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
86 log.error(traceback.format_exc()) |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
87 h.flash(str(e), category='warning') |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
88 return redirect(url('home')) |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
89 |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
90 self._graph(c.rhodecode_repo, collection, c.total_cs, c.size, p) |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
91 |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
92 c.branch_name = branch_name |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
93 c.branch_filters = [('',_('All Branches'))] + \ |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
94 [(k,k) for k in c.rhodecode_repo.branches.keys()] |
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
95 |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
96 |
142
f7218849798a
Changeg graph to changelog, and changelog to shortlog
Marcin Kuzminski <marcin@python-works.com>
parents:
127
diff
changeset
|
97 return render('changelog/changelog.html') |
f7218849798a
Changeg graph to changelog, and changelog to shortlog
Marcin Kuzminski <marcin@python-works.com>
parents:
127
diff
changeset
|
98 |
1431
d5d7c40e8591
changelog uses lazy loading of affected files details, in some scenarios this can improve speed
Marcin Kuzminski <marcin@python-works.com>
parents:
1412
diff
changeset
|
99 def changelog_details(self, cs): |
d5d7c40e8591
changelog uses lazy loading of affected files details, in some scenarios this can improve speed
Marcin Kuzminski <marcin@python-works.com>
parents:
1412
diff
changeset
|
100 if request.environ.get('HTTP_X_PARTIAL_XHR'): |
d5d7c40e8591
changelog uses lazy loading of affected files details, in some scenarios this can improve speed
Marcin Kuzminski <marcin@python-works.com>
parents:
1412
diff
changeset
|
101 c.cs = c.rhodecode_repo.get_changeset(cs) |
d5d7c40e8591
changelog uses lazy loading of affected files details, in some scenarios this can improve speed
Marcin Kuzminski <marcin@python-works.com>
parents:
1412
diff
changeset
|
102 return render('changelog/changelog_details.html') |
d5d7c40e8591
changelog uses lazy loading of affected files details, in some scenarios this can improve speed
Marcin Kuzminski <marcin@python-works.com>
parents:
1412
diff
changeset
|
103 |
1656
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
104 def _graph(self, repo, collection, repo_size, size, p): |
1083
9b2c21245198
DAG fixes for vcs 0.2.0
Marcin Kuzminski <marcin@python-works.com>
parents:
1045
diff
changeset
|
105 """ |
9b2c21245198
DAG fixes for vcs 0.2.0
Marcin Kuzminski <marcin@python-works.com>
parents:
1045
diff
changeset
|
106 Generates a DAG graph for mercurial |
1203
6832ef664673
source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents:
1130
diff
changeset
|
107 |
1083
9b2c21245198
DAG fixes for vcs 0.2.0
Marcin Kuzminski <marcin@python-works.com>
parents:
1045
diff
changeset
|
108 :param repo: repo instance |
9b2c21245198
DAG fixes for vcs 0.2.0
Marcin Kuzminski <marcin@python-works.com>
parents:
1045
diff
changeset
|
109 :param size: number of commits to show |
9b2c21245198
DAG fixes for vcs 0.2.0
Marcin Kuzminski <marcin@python-works.com>
parents:
1045
diff
changeset
|
110 :param p: page number |
9b2c21245198
DAG fixes for vcs 0.2.0
Marcin Kuzminski <marcin@python-works.com>
parents:
1045
diff
changeset
|
111 """ |
1656
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
112 if not collection: |
699
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
691
diff
changeset
|
113 c.jsdata = json.dumps([]) |
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
691
diff
changeset
|
114 return |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
115 |
1109
41a695e604ba
small fixes, and optimization for changelog graph
Marcin Kuzminski <marcin@python-works.com>
parents:
1106
diff
changeset
|
116 revcount = min(repo_size, size) |
322
46b7d108ea7a
made graphg ticker, and fixes a paging bug caused grapgh disaligment
Marcin Kuzminski <marcin@python-works.com>
parents:
318
diff
changeset
|
117 offset = 1 if p == 1 else ((p - 1) * revcount + 1) |
1331
1188920ae12c
fixed error when given page in pagination was out of range in changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
1281
diff
changeset
|
118 try: |
1656
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
119 rev_end = collection.index(collection[(-1 * offset)]) |
1331
1188920ae12c
fixed error when given page in pagination was out of range in changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
1281
diff
changeset
|
120 except IndexError: |
1656
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
121 rev_end = collection.index(collection[-1]) |
1412
5f878edbee00
Bumped Mercurial to 1.9 and fixed graphlog for this version
Marcin Kuzminski <marcin@python-works.com>
parents:
1331
diff
changeset
|
122 rev_start = max(0, rev_end - revcount) |
1331
1188920ae12c
fixed error when given page in pagination was out of range in changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
1281
diff
changeset
|
123 |
288
ab1afe7444f3
Initial graph release.
Marcin Kuzminski <marcin@python-works.com>
parents:
282
diff
changeset
|
124 data = [] |
1434
d21c14e36fa8
fixes issues with new dag graph for mercurial 1.9
Marcin Kuzminski <marcin@python-works.com>
parents:
1431
diff
changeset
|
125 rev_end += 1 |
d21c14e36fa8
fixes issues with new dag graph for mercurial 1.9
Marcin Kuzminski <marcin@python-works.com>
parents:
1431
diff
changeset
|
126 |
1281
0d3706ccf129
small fixes for git support
Marcin Kuzminski <marcin@python-works.com>
parents:
1212
diff
changeset
|
127 if repo.alias == 'git': |
1412
5f878edbee00
Bumped Mercurial to 1.9 and fixed graphlog for this version
Marcin Kuzminski <marcin@python-works.com>
parents:
1331
diff
changeset
|
128 for _ in xrange(rev_start, rev_end): |
1281
0d3706ccf129
small fixes for git support
Marcin Kuzminski <marcin@python-works.com>
parents:
1212
diff
changeset
|
129 vtx = [0, 1] |
0d3706ccf129
small fixes for git support
Marcin Kuzminski <marcin@python-works.com>
parents:
1212
diff
changeset
|
130 edges = [[0, 0, 1]] |
0d3706ccf129
small fixes for git support
Marcin Kuzminski <marcin@python-works.com>
parents:
1212
diff
changeset
|
131 data.append(['', vtx, edges]) |
0d3706ccf129
small fixes for git support
Marcin Kuzminski <marcin@python-works.com>
parents:
1212
diff
changeset
|
132 |
0d3706ccf129
small fixes for git support
Marcin Kuzminski <marcin@python-works.com>
parents:
1212
diff
changeset
|
133 elif repo.alias == 'hg': |
1412
5f878edbee00
Bumped Mercurial to 1.9 and fixed graphlog for this version
Marcin Kuzminski <marcin@python-works.com>
parents:
1331
diff
changeset
|
134 revs = list(reversed(xrange(rev_start, rev_end))) |
5f878edbee00
Bumped Mercurial to 1.9 and fixed graphlog for this version
Marcin Kuzminski <marcin@python-works.com>
parents:
1331
diff
changeset
|
135 c.dag = graphmod.colored(graphmod.dagwalker(repo._repo, revs)) |
5f878edbee00
Bumped Mercurial to 1.9 and fixed graphlog for this version
Marcin Kuzminski <marcin@python-works.com>
parents:
1331
diff
changeset
|
136 for (id, type, ctx, vtx, edges) in c.dag: |
5f878edbee00
Bumped Mercurial to 1.9 and fixed graphlog for this version
Marcin Kuzminski <marcin@python-works.com>
parents:
1331
diff
changeset
|
137 if type != graphmod.CHANGESET: |
1281
0d3706ccf129
small fixes for git support
Marcin Kuzminski <marcin@python-works.com>
parents:
1212
diff
changeset
|
138 continue |
0d3706ccf129
small fixes for git support
Marcin Kuzminski <marcin@python-works.com>
parents:
1212
diff
changeset
|
139 data.append(['', vtx, edges]) |
142
f7218849798a
Changeg graph to changelog, and changelog to shortlog
Marcin Kuzminski <marcin@python-works.com>
parents:
127
diff
changeset
|
140 |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
141 c.jsdata = json.dumps(data) |
1656
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
142 |