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