Show More
@@ -31,7 +31,7 except ImportError: | |||||
31 | #python 2.5 compatibility |
|
31 | #python 2.5 compatibility | |
32 | import simplejson as json |
|
32 | import simplejson as json | |
33 |
|
33 | |||
34 | from mercurial.graphmod import colored, CHANGESET, revisions as graph_rev |
|
34 | from mercurial import graphmod | |
35 | from pylons import request, session, tmpl_context as c |
|
35 | from pylons import request, session, tmpl_context as c | |
36 |
|
36 | |||
37 | from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator |
|
37 | from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator | |
@@ -91,24 +91,23 class ChangelogController(BaseRepoContro | |||||
91 | revcount = min(repo_size, size) |
|
91 | revcount = min(repo_size, size) | |
92 | offset = 1 if p == 1 else ((p - 1) * revcount + 1) |
|
92 | offset = 1 if p == 1 else ((p - 1) * revcount + 1) | |
93 | try: |
|
93 | try: | |
94 |
rev_ |
|
94 | rev_end = repo.revisions.index(repo.revisions[(-1 * offset)]) | |
95 | except IndexError: |
|
95 | except IndexError: | |
96 |
rev_ |
|
96 | rev_end = repo.revisions.index(repo.revisions[-1]) | |
97 |
rev_ |
|
97 | rev_start = max(0, rev_end - revcount) | |
98 |
|
||||
99 |
|
98 | |||
100 | data = [] |
|
99 | data = [] | |
101 | if repo.alias == 'git': |
|
100 | if repo.alias == 'git': | |
102 |
for _ in xrange(rev_ |
|
101 | for _ in xrange(rev_start, rev_end): | |
103 | vtx = [0, 1] |
|
102 | vtx = [0, 1] | |
104 | edges = [[0, 0, 1]] |
|
103 | edges = [[0, 0, 1]] | |
105 | data.append(['', vtx, edges]) |
|
104 | data.append(['', vtx, edges]) | |
106 |
|
105 | |||
107 | elif repo.alias == 'hg': |
|
106 | elif repo.alias == 'hg': | |
108 |
|
|
107 | revs = list(reversed(xrange(rev_start, rev_end))) | |
109 | c.dag = tree = list(colored(dag)) |
|
108 | c.dag = graphmod.colored(graphmod.dagwalker(repo._repo, revs)) | |
110 |
for (id, type, ctx, vtx, edges) in |
|
109 | for (id, type, ctx, vtx, edges) in c.dag: | |
111 | if type != CHANGESET: |
|
110 | if type != graphmod.CHANGESET: | |
112 | continue |
|
111 | continue | |
113 | data.append(['', vtx, edges]) |
|
112 | data.append(['', vtx, edges]) | |
114 |
|
113 |
General Comments 0
You need to be logged in to leave comments.
Login now