# HG changeset patch # User Mads Kiilerich # Date 1405704121 -7200 # Node ID 3136811db1afb977ae5ff3ad613c489ab4a1c4e4 # Parent 7879d8d88672eb0a879233fa5a293a4dbe3d424e compare: introduce .cs_repo as the repo for .cs_changes - sometimes it is org, sometimes other Influences pull request creation, display and compare. diff -r 7879d8d88672 -r 3136811db1af kallithea/controllers/changeset.py --- a/kallithea/controllers/changeset.py Fri Jul 04 14:12:06 2014 +0200 +++ b/kallithea/controllers/changeset.py Fri Jul 18 19:22:01 2014 +0200 @@ -192,6 +192,7 @@ #get ranges of revisions if preset rev_range = revision.split('...')[:2] enable_comments = True + c.cs_repo = c.db_repo try: if len(rev_range) == 2: enable_comments = False diff -r 7879d8d88672 -r 3136811db1af kallithea/controllers/compare.py --- a/kallithea/controllers/compare.py Fri Jul 04 14:12:06 2014 +0200 +++ b/kallithea/controllers/compare.py Fri Jul 18 19:22:01 2014 +0200 @@ -219,6 +219,7 @@ c.org_ref_type = org_ref_type c.other_ref_type = other_ref_type + c.cs_repo = other_repo c.cs_ranges, c.cs_ranges_org, c.ancestor = self._get_changesets( org_repo.scm_instance.alias, org_repo.scm_instance, c.org_rev, other_repo.scm_instance, c.other_rev) diff -r 7879d8d88672 -r 3136811db1af kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py Fri Jul 04 14:12:06 2014 +0200 +++ b/kallithea/controllers/pullrequests.py Fri Jul 18 19:22:01 2014 +0200 @@ -199,6 +199,7 @@ c.other_rev) = pull_request.other_ref.split(':') org_scm_instance = c.org_repo.scm_instance # property with expensive cache invalidation check!!! + c.cs_repo = c.org_repo 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)] diff -r 7879d8d88672 -r 3136811db1af kallithea/templates/changeset/changeset_range.html --- a/kallithea/templates/changeset/changeset_range.html Fri Jul 04 14:12:06 2014 +0200 +++ b/kallithea/templates/changeset/changeset_range.html Fri Jul 18 19:22:01 2014 +0200 @@ -43,7 +43,7 @@ %for cnt,cs in enumerate(c.cs_ranges):
gravatar
- ${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} + ${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}
${h.person(cs.author)}
${cs.date} @@ -59,7 +59,7 @@
${_('Files affected')}
%for cs in c.cs_ranges: -
${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
+
${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}
%for FID, (cs1, cs2, change, path, diff, stats) in c.changes[cs.raw_id].iteritems():
@@ -79,7 +79,7 @@ ##${comment.comment_inline_form(cs)} ## diff block
- ${h.show_id(cs)} + ${h.show_id(cs)}
gravatar
@@ -91,17 +91,17 @@ %if h.is_hg(c.db_repo_scm_instance): %for book in cs.bookmarks: - ${h.link_to(book,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} + ${h.link_to(book,h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))} %endfor %endif %for tag in cs.tags: - ${h.link_to(tag,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} + ${h.link_to(tag,h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))} %endfor %if cs.branch: - ${h.link_to(cs.branch,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} + ${h.link_to(cs.branch,h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))} %endif diff -r 7879d8d88672 -r 3136811db1af kallithea/templates/compare/compare_cs.html --- a/kallithea/templates/compare/compare_cs.html Fri Jul 04 14:12:06 2014 +0200 +++ b/kallithea/templates/compare/compare_cs.html Fri Jul 18 19:22:01 2014 +0200 @@ -28,7 +28,7 @@ %if c.cs_comments.get(cs.raw_id):
- + ${len(c.cs_comments[cs.raw_id])} @@ -39,10 +39,10 @@ ${cs.date}
gravatar
${h.person(cs.author)}
- ${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.other_repo.repo_name,revision=cs.raw_id))} + ${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))} %if cs.branch: - ${h.link_to(cs.branch,h.url('changelog_home',repo_name=c.other_repo.repo_name,branch=cs.branch))} + ${h.link_to(cs.branch,h.url('changelog_home',repo_name=c.cs_repo.repo_name,branch=cs.branch))} %endif @@ -116,4 +116,4 @@ }); }); - \ No newline at end of file +