# HG changeset patch # User Mads Kiilerich # Date 1386700237 -3600 # Node ID c733124b6262d460e0843ba6fee98fc859912190 # Parent f22d103ba9e8866d0ee87da4f1426ed1e68d4b9f pull requests: show graph when displaying PR diff -r f22d103ba9e8 -r c733124b6262 kallithea/controllers/changeset.py --- a/kallithea/controllers/changeset.py Fri Jul 18 18:45:54 2014 +0200 +++ b/kallithea/controllers/changeset.py Tue Dec 10 19:30:37 2013 +0100 @@ -39,6 +39,7 @@ from kallithea.lib.vcs.exceptions import RepositoryError, \ ChangesetDoesNotExistError +from kallithea.lib.compat import json import kallithea.lib.helpers as h from kallithea.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator,\ NotAnonymous @@ -55,6 +56,7 @@ from kallithea.lib.exceptions import StatusChangeOnClosedPullRequestError from kallithea.lib.vcs.backends.base import EmptyChangeset from kallithea.lib.utils2 import safe_unicode, safe_str +from kallithea.lib.graphmod import graph_data log = logging.getLogger(__name__) @@ -313,6 +315,8 @@ return render('changeset/changeset.html') else: c.cs_ranges_org = None + revs = [ctx.revision for ctx in reversed(c.cs_ranges)] + c.jsdata = json.dumps(graph_data(c.db_repo_scm_instance, revs)) return render('changeset/changeset_range.html') @LoginRequired() diff -r f22d103ba9e8 -r c733124b6262 kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py Fri Jul 18 18:45:54 2014 +0200 +++ b/kallithea/controllers/pullrequests.py Tue Dec 10 19:30:37 2013 +0100 @@ -60,6 +60,7 @@ from kallithea.controllers.changeset import anchor_url, _ignorews_url,\ _context_url, get_line_ctx, get_ignore_ws from kallithea.controllers.compare import CompareController +from kallithea.lib.graphmod import graph_data log = logging.getLogger(__name__) @@ -200,6 +201,8 @@ org_scm_instance = c.org_repo.scm_instance # property with expensive cache invalidation check!!! c.cs_ranges = [org_scm_instance.get_changeset(x) for x in pull_request.revisions] c.cs_ranges_org = None # not stored and not important and moving target - could be calculated ... + revs = [ctx.revision for ctx in reversed(c.cs_ranges)] + c.jsdata = json.dumps(graph_data(org_scm_instance, revs)) c.statuses = c.org_repo.statuses([x.raw_id for x in c.cs_ranges]) diff -r f22d103ba9e8 -r c733124b6262 kallithea/templates/compare/compare_cs.html --- a/kallithea/templates/compare/compare_cs.html Fri Jul 18 18:45:54 2014 +0200 +++ b/kallithea/templates/compare/compare_cs.html Tue Dec 10 19:30:37 2013 +0100 @@ -10,9 +10,15 @@ %endif +
+ +
+ +
+ - %for cs in reversed(c.cs_ranges): - + %for cnt, cs in enumerate(c.cs_ranges): + %endfor
%if cs.raw_id in c.statuses:
@@ -36,6 +42,9 @@
+ +
+ %if c.as_form:
## links should perhaps use ('rev', c.org_rev) instead ... @@ -70,13 +79,29 @@ %endif
- +%if not c.as_form: + +%endif + + \ No newline at end of file