changeset 4460:6cb077e99873

diff: rename template values for org and other for compare and PR sed -i -e 's,\<\(c\.\(default_\)\?\)org_,\1a_,g' -e 's,\<\(c\.\(default_\)\?\)other_,\1cs_,g' kallithea/controllers/compare.py kallithea/templates/compare/compare_cs.html kallithea/templates/compare/compare_diff.html sed -i -e 's,\<\(c\.\(default_\)\?\)org_,\1cs_,g' -e 's,\<\(c\.\(default_\)\?\)other_,\1a_,g' kallithea/controllers/pullrequests.py kallithea/templates/pullrequests/pullrequest.html kallithea/templates/pullrequests/pullrequest_show.html kallithea/templates/changeset/diff_block.html Renaming it differently for compare and PR finally fixes some issues with diffs and links pointing at wrong revisions and repos - no more whac-a-mole.
author Mads Kiilerich <madski@unity3d.com>
date Thu, 21 Aug 2014 23:46:55 +0200
parents 296b37f6fcdc
children d6e96730edfb
files kallithea/controllers/compare.py kallithea/controllers/pullrequests.py kallithea/templates/changeset/diff_block.html kallithea/templates/compare/compare_cs.html kallithea/templates/compare/compare_diff.html kallithea/templates/pullrequests/pullrequest.html kallithea/templates/pullrequests/pullrequest_show.html
diffstat 7 files changed, 90 insertions(+), 90 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/compare.py	Thu Aug 21 23:46:55 2014 +0200
+++ b/kallithea/controllers/compare.py	Thu Aug 21 23:46:55 2014 +0200
@@ -149,9 +149,9 @@
         c.compare_home = True
         org_repo = c.db_repo.repo_name
         other_repo = request.GET.get('other_repo', org_repo)
-        c.org_repo = Repository.get_by_repo_name(org_repo)
-        c.other_repo = Repository.get_by_repo_name(other_repo)
-        c.org_ref_name = c.other_ref_name = _('Select changeset')
+        c.a_repo = Repository.get_by_repo_name(org_repo)
+        c.cs_repo = Repository.get_by_repo_name(other_repo)
+        c.a_ref_name = c.cs_ref_name = _('Select changeset')
         return render('compare/compare_diff.html')
 
     @LoginRequired()
@@ -210,27 +210,27 @@
             h.flash(msg, category='error')
             return redirect(url('compare_home', repo_name=c.repo_name))
 
-        c.org_rev = self._get_ref_rev(org_repo, org_ref_type, org_ref_name)
-        c.other_rev = self._get_ref_rev(other_repo, other_ref_type, other_ref_name)
+        c.a_rev = self._get_ref_rev(org_repo, org_ref_type, org_ref_name)
+        c.cs_rev = self._get_ref_rev(other_repo, other_ref_type, other_ref_name)
 
         c.compare_home = False
-        c.org_repo = org_repo
-        c.other_repo = other_repo
-        c.org_ref_name = org_ref_name
-        c.other_ref_name = other_ref_name
-        c.org_ref_type = org_ref_type
-        c.other_ref_type = other_ref_type
+        c.a_repo = org_repo
+        c.cs_repo = other_repo
+        c.a_ref_name = org_ref_name
+        c.cs_ref_name = other_ref_name
+        c.a_ref_type = org_ref_type
+        c.cs_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)
+            org_repo.scm_instance.alias, org_repo.scm_instance, c.a_rev,
+            other_repo.scm_instance, c.cs_rev)
         raw_ids = [x.raw_id for x in c.cs_ranges]
         c.cs_comments = other_repo.get_comments(raw_ids)
         c.statuses = other_repo.statuses(raw_ids)
 
         revs = [ctx.revision for ctx in reversed(c.cs_ranges)]
-        c.jsdata = json.dumps(graph_data(c.other_repo.scm_instance, revs))
+        c.jsdata = json.dumps(graph_data(c.cs_repo.scm_instance, revs))
 
         if partial:
             return render('compare/compare_cs.html')
@@ -239,7 +239,7 @@
             # previewing what will be merged.
             # Make the diff on the other repo (which is known to have other_rev)
             log.debug('Using ancestor %s as rev1 instead of %s'
-                      % (c.ancestor, c.org_rev))
+                      % (c.ancestor, c.a_rev))
             rev1 = c.ancestor
             org_repo = other_repo
         else: # comparing tips, not necessarily linearly related
@@ -250,13 +250,13 @@
                 log.error('cannot compare across repos %s and %s', org_repo, other_repo)
                 h.flash(_('Cannot compare repositories without using common ancestor'), category='error')
                 raise HTTPBadRequest
-            rev1 = c.org_rev
+            rev1 = c.a_rev
 
         diff_limit = self.cut_off_limit if not c.fulldiff else None
 
         log.debug('running diff between %s and %s in %s'
-                  % (rev1, c.other_rev, org_repo.scm_instance.path))
-        txtdiff = org_repo.scm_instance.get_diff(rev1=rev1, rev2=c.other_rev,
+                  % (rev1, c.cs_rev, org_repo.scm_instance.path))
+        txtdiff = org_repo.scm_instance.get_diff(rev1=rev1, rev2=c.cs_rev,
                                       ignore_whitespace=ignore_whitespace,
                                       context=line_context)
 
--- a/kallithea/controllers/pullrequests.py	Thu Aug 21 23:46:55 2014 +0200
+++ b/kallithea/controllers/pullrequests.py	Thu Aug 21 23:46:55 2014 +0200
@@ -259,26 +259,26 @@
         #other_rev = request.POST.get('rev_start')
         branch = request.GET.get('branch')
 
-        c.org_repos = [(org_repo.repo_name, org_repo.repo_name)]
-        c.default_org_repo = org_repo.repo_name
-        c.org_refs, c.default_org_ref = self._get_repo_refs(org_scm_instance, rev=org_rev, branch=branch)
+        c.cs_repos = [(org_repo.repo_name, org_repo.repo_name)]
+        c.default_cs_repo = org_repo.repo_name
+        c.cs_refs, c.default_cs_ref = self._get_repo_refs(org_scm_instance, rev=org_rev, branch=branch)
 
         # add org repo to other so we can open pull request against peer branches on itself
-        c.other_repos = [(org_repo.repo_name, '%s (self)' % org_repo.repo_name)]
+        c.a_repos = [(org_repo.repo_name, '%s (self)' % org_repo.repo_name)]
 
         # add parent of this fork also and select it
         if org_repo.parent:
-            c.other_repos.append((org_repo.parent.repo_name, '%s (parent)' % org_repo.parent.repo_name))
-            c.other_repo = org_repo.parent
-            c.other_refs, c.default_other_ref = self._get_repo_refs(org_repo.parent.scm_instance)
+            c.a_repos.append((org_repo.parent.repo_name, '%s (parent)' % org_repo.parent.repo_name))
+            c.a_repo = org_repo.parent
+            c.a_refs, c.default_a_ref = self._get_repo_refs(org_repo.parent.scm_instance)
         else:
-            c.other_repo = org_repo
-            c.other_refs, c.default_other_ref = self._get_repo_refs(org_scm_instance) # without rev and branch
+            c.a_repo = org_repo
+            c.a_refs, c.default_a_ref = self._get_repo_refs(org_scm_instance) # without rev and branch
 
         # gather forks and add to this list ... even though it is rare to
         # request forks to pull from their parent
         for fork in org_repo.forks:
-            c.other_repos.append((fork.repo_name, fork.repo_name))
+            c.a_repos.append((fork.repo_name, fork.repo_name))
 
         return render('/pullrequests/pullrequest.html')
 
@@ -553,32 +553,32 @@
             raise HTTPNotFound
 
         # load compare data into template context
-        c.org_repo = c.pull_request.org_repo
-        (c.org_ref_type,
-         c.org_ref_name,
-         c.org_rev) = c.pull_request.org_ref.split(':')
+        c.cs_repo = c.pull_request.org_repo
+        (c.cs_ref_type,
+         c.cs_ref_name,
+         c.cs_rev) = c.pull_request.org_ref.split(':')
 
-        c.other_repo = c.pull_request.other_repo
-        (c.other_ref_type,
-         c.other_ref_name,
-         c.other_rev) = c.pull_request.other_ref.split(':') # other_rev is ancestor
+        c.a_repo = c.pull_request.other_repo
+        (c.a_ref_type,
+         c.a_ref_name,
+         c.a_rev) = c.pull_request.other_ref.split(':') # other_rev is ancestor
 
-        org_scm_instance = c.org_repo.scm_instance # property with expensive cache invalidation check!!!
-        c.cs_repo = c.org_repo
+        org_scm_instance = c.cs_repo.scm_instance # property with expensive cache invalidation check!!!
+        c.cs_repo = c.cs_repo
         c.cs_ranges = [org_scm_instance.get_changeset(x) for x in c.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.available = []
-        c.org_branch_name = c.org_ref_name
-        other_scm_instance = c.other_repo.scm_instance
-        if org_scm_instance.alias == 'hg' and c.other_ref_name != 'ancestor':
-            if c.org_ref_type != 'branch':
-                c.org_branch_name = org_scm_instance.get_changeset(c.org_ref_name).branch # use ref_type ?
-            other_branch_name = c.other_ref_name
-            if c.other_ref_type != 'branch':
-                other_branch_name = other_scm_instance.get_changeset(c.other_ref_name).branch # use ref_type ?
+        c.cs_branch_name = c.cs_ref_name
+        other_scm_instance = c.a_repo.scm_instance
+        if org_scm_instance.alias == 'hg' and c.a_ref_name != 'ancestor':
+            if c.cs_ref_type != 'branch':
+                c.cs_branch_name = org_scm_instance.get_changeset(c.cs_ref_name).branch # use ref_type ?
+            other_branch_name = c.a_ref_name
+            if c.a_ref_type != 'branch':
+                other_branch_name = other_scm_instance.get_changeset(c.a_ref_name).branch # use ref_type ?
             # candidates: descendants of old head that are on the right branch
             #             and not are the old head itself ...
             #             and nothing at all if old head is a descendent of target ref name
@@ -586,26 +586,26 @@
                 c.update_msg = _('This pull request has already been merged to %s.') % other_branch_name
             else: # look for children of PR head on source branch in org repo
                 arevs = org_scm_instance._repo.revs('%s:: & branch(%s) - %s',
-                                                    revs[0], c.org_branch_name, revs[0])
+                                                    revs[0], c.cs_branch_name, revs[0])
                 if arevs:
                     if c.pull_request.is_closed():
-                        c.update_msg = _('This pull request has been closed and can not be updated with descendent changes on %s:') % c.org_branch_name
+                        c.update_msg = _('This pull request has been closed and can not be updated with descendent changes on %s:') % c.cs_branch_name
                     else:
-                        c.update_msg = _('This pull request can be updated with descendent changes on %s:') % c.org_branch_name
+                        c.update_msg = _('This pull request can be updated with descendent changes on %s:') % c.cs_branch_name
                     c.available = [org_scm_instance.get_changeset(x) for x in arevs]
                 else:
                     c.update_msg = _('No changesets found for updating this pull request.')
 
-            revs = org_scm_instance._repo.revs('head() & not (%s::) & branch(%s) & !closed()', revs[0], c.org_branch_name)
+            revs = org_scm_instance._repo.revs('head() & not (%s::) & branch(%s) & !closed()', revs[0], c.cs_branch_name)
             if revs:
-                c.update_msg_other = _('Note: Branch %s also contains unrelated changes, such as %s.') % (c.org_branch_name,
+                c.update_msg_other = _('Note: Branch %s also contains unrelated changes, such as %s.') % (c.cs_branch_name,
                     h.short_id(org_scm_instance.get_changeset((max(revs))).raw_id))
             else:
-                c.update_msg_other = _('Branch %s does not contain other changes.') % c.org_branch_name
+                c.update_msg_other = _('Branch %s does not contain other changes.') % c.cs_branch_name
 
         raw_ids = [x.raw_id for x in c.cs_ranges]
-        c.cs_comments = c.org_repo.get_comments(raw_ids)
-        c.statuses = c.org_repo.statuses(raw_ids)
+        c.cs_comments = c.cs_repo.get_comments(raw_ids)
+        c.statuses = c.cs_repo.statuses(raw_ids)
 
         ignore_whitespace = request.GET.get('ignorews') == '1'
         line_context = request.GET.get('context', 3)
@@ -616,8 +616,8 @@
 
         # we swap org/other ref since we run a simple diff on one repo
         log.debug('running diff between %s and %s in %s'
-                  % (c.other_rev, c.org_rev, org_scm_instance.path))
-        txtdiff = org_scm_instance.get_diff(rev1=safe_str(c.other_rev), rev2=safe_str(c.org_rev),
+                  % (c.a_rev, c.cs_rev, org_scm_instance.path))
+        txtdiff = org_scm_instance.get_diff(rev1=safe_str(c.a_rev), rev2=safe_str(c.cs_rev),
                                       ignore_whitespace=ignore_whitespace,
                                       context=line_context)
 
--- a/kallithea/templates/changeset/diff_block.html	Thu Aug 21 23:46:55 2014 +0200
+++ b/kallithea/templates/changeset/diff_block.html	Thu Aug 21 23:46:55 2014 +0200
@@ -78,20 +78,20 @@
                   ## TODO: link to ancestor and head of other instead of exactly other
                   %if op == 'A':
                     ${_('Added')}
-                    <a class="spantag" href="${h.url('files_home', repo_name=c.org_repo.repo_name, f_path=filenode_path, revision=c.org_rev)}">${h.short_id(c.org_ref_name) if c.org_ref_type=='rev' else c.org_ref_name}</a>
+                    <a class="spantag" href="${h.url('files_home', repo_name=c.cs_repo.repo_name, f_path=filenode_path, revision=c.cs_rev)}">${h.short_id(c.cs_ref_name) if c.cs_ref_type=='rev' else c.cs_ref_name}</a>
                   %elif op == 'M':
-                    <a class="spantag" href="${h.url('files_home', repo_name=c.org_repo.repo_name, f_path=filenode_path, revision=c.org_rev)}">${h.short_id(c.org_ref_name) if c.org_ref_type=='rev' else c.org_ref_name}</a>
+                    <a class="spantag" href="${h.url('files_home', repo_name=c.cs_repo.repo_name, f_path=filenode_path, revision=c.cs_rev)}">${h.short_id(c.cs_ref_name) if c.cs_ref_type=='rev' else c.cs_ref_name}</a>
                     <i class="icon-arrow-right"></i>
-                    <a class="spantag" href="${h.url('files_home', repo_name=c.other_repo.repo_name, f_path=filenode_path, revision=c.other_rev)}">${h.short_id(c.other_ref_name) if c.other_ref_type=='rev' else c.other_ref_name}</a>
+                    <a class="spantag" href="${h.url('files_home', repo_name=c.a_repo.repo_name, f_path=filenode_path, revision=c.a_rev)}">${h.short_id(c.a_ref_name) if c.a_ref_type=='rev' else c.a_ref_name}</a>
                   %elif op == 'D':
                     ${_('Deleted')}
-                    <a class="spantag" href="${h.url('files_home', repo_name=c.other_repo.repo_name, f_path=filenode_path, revision=c.other_rev)}">${h.short_id(c.other_ref_name) if c.other_ref_type=='rev' else c.other_ref_name}</a>
+                    <a class="spantag" href="${h.url('files_home', repo_name=c.a_repo.repo_name, f_path=filenode_path, revision=c.a_rev)}">${h.short_id(c.a_ref_name) if c.a_ref_type=='rev' else c.a_ref_name}</a>
                   %else:
                     ${op}???
                   %endif
               </div>
               <div class="diff-actions">
-                <a href="${h.url('files_diff_2way_home',repo_name=c.org_repo.repo_name,f_path=h.safe_unicode(filenode_path),diff1=c.other_rev,diff2=c.org_rev,diff='diff',fulldiff=1)}" class="tooltip" title="${h.tooltip(_('Show full side-by-side diff for this file'))}">
+                <a href="${h.url('files_diff_2way_home',repo_name=c.cs_repo.repo_name,f_path=h.safe_unicode(filenode_path),diff1=c.a_rev,diff2=c.cs_rev,diff='diff',fulldiff=1)}" class="tooltip" title="${h.tooltip(_('Show full side-by-side diff for this file'))}">
                   <img class="icon" src="${h.url('/images/icons/application_double.png')}"/>
                 </a>
                 ${c.ignorews_url(request.GET)}
@@ -110,11 +110,11 @@
               <div style="font-size: 0">
                 %if op == 'M':
                   <img id="${h.FID('',filenode_path)}_image-diff-img-a" class="img-diff img-diff-swapable" style="display:none"
-                      realsrc="${h.url('files_raw_home',repo_name=c.other_repo.repo_name,revision=c.other_rev,f_path=filenode_path) if op in 'DM' else ''}" />
+                      realsrc="${h.url('files_raw_home',repo_name=c.a_repo.repo_name,revision=c.a_rev,f_path=filenode_path) if op in 'DM' else ''}" />
                 %endif
                 %if op in 'AM':
                   <img id="${h.FID('',filenode_path)}_image-diff-img-b" class="img-diff img-diff-swapable" style="display:none"
-                      realsrc="${h.url('files_raw_home',repo_name=c.org_repo.repo_name,revision=c.org_rev,f_path=filenode_path) if op in 'AM' else ''}" />
+                      realsrc="${h.url('files_raw_home',repo_name=c.cs_repo.repo_name,revision=c.cs_rev,f_path=filenode_path) if op in 'AM' else ''}" />
                 %endif
               </div>
             %endif
--- a/kallithea/templates/compare/compare_cs.html	Thu Aug 21 23:46:55 2014 +0200
+++ b/kallithea/templates/compare/compare_cs.html	Thu Aug 21 23:46:55 2014 +0200
@@ -57,13 +57,13 @@
 
     %if c.as_form:
       <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">
-      ## links should perhaps use ('rev', c.org_rev) instead ...
+      ## links should perhaps use ('rev', c.a_rev) instead ...
       ${h.link_to(_('Show merge diff'),
         h.url('compare_url',
-          repo_name=c.org_repo.repo_name,
-          org_ref_type=c.org_ref_type, org_ref_name=c.org_ref_name,
-          other_repo=c.other_repo.repo_name,
-          other_ref_type=c.other_ref_type, other_ref_name=c.other_ref_name,
+          repo_name=c.a_repo.repo_name,
+          org_ref_type=c.a_ref_type, org_ref_name=c.a_ref_name,
+          other_repo=c.cs_repo.repo_name,
+          other_ref_type=c.cs_ref_type, other_ref_name=c.cs_ref_name,
           merge='1'),
         )}
       </div>
@@ -79,11 +79,11 @@
     %if c.cs_ranges_org is not None:
       ## TODO: list actual changesets?
       <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">
-        ${h.link_to_ref(c.other_repo.repo_name, c.other_ref_type, c.other_ref_name, c.other_rev)}
+        ${h.link_to_ref(c.cs_repo.repo_name, c.cs_ref_type, c.cs_ref_name, c.cs_rev)}
         ${_('is')}
         <a href="${c.swap_url}">${_('%s changesets') % (len(c.cs_ranges_org))}</a>
         ${_('behind')}
-        ${h.link_to_ref(c.org_repo.repo_name, c.org_ref_type, c.org_ref_name, c.org_rev)}
+        ${h.link_to_ref(c.a_repo.repo_name, c.a_ref_type, c.a_ref_name, c.a_rev)}
       </div>
     %endif
   %endif
--- a/kallithea/templates/compare/compare_diff.html	Thu Aug 21 23:46:55 2014 +0200
+++ b/kallithea/templates/compare/compare_diff.html	Thu Aug 21 23:46:55 2014 +0200
@@ -5,7 +5,7 @@
     %if c.compare_home:
         ${_('%s Compare') % c.repo_name}
     %else:
-        ${_('%s Compare') % c.repo_name} - ${'%s@%s' % (c.org_repo.repo_name, c.org_ref_name)} &gt; ${'%s@%s' % (c.other_repo.repo_name, c.other_ref_name)}
+        ${_('%s Compare') % c.repo_name} - ${'%s@%s' % (c.a_repo.repo_name, c.a_ref_name)} &gt; ${'%s@%s' % (c.cs_repo.repo_name, c.cs_ref_name)}
     %endif
     %if c.site_name:
         &middot; ${c.site_name}
@@ -97,9 +97,9 @@
    $(document).ready(function(){
     var cache = {}
     $("#compare_org").select2({
-        placeholder: "${'%s@%s' % (c.org_repo.repo_name, c.org_ref_name)}",
+        placeholder: "${'%s@%s' % (c.a_repo.repo_name, c.a_ref_name)}",
         formatSelection: function(obj){
-            return '{0}@{1}'.format("${c.org_repo.repo_name}", obj.text)
+            return '{0}@{1}'.format("${c.a_repo.repo_name}", obj.text)
         },
         dropdownAutoWidth: true,
         query: function(query){
@@ -124,7 +124,7 @@
             query.callback(data);
           }else{
               $.ajax({
-                url: pyroutes.url('repo_refs_data', {'repo_name': '${c.org_repo.repo_name}'}),
+                url: pyroutes.url('repo_refs_data', {'repo_name': '${c.a_repo.repo_name}'}),
                 data: {},
                 dataType: 'json',
                 type: 'GET',
@@ -137,10 +137,10 @@
         },
     });
     $("#compare_other").select2({
-        placeholder: "${'%s@%s' % (c.other_repo.repo_name, c.other_ref_name)}",
+        placeholder: "${'%s@%s' % (c.cs_repo.repo_name, c.cs_ref_name)}",
         dropdownAutoWidth: true,
         formatSelection: function(obj){
-            return '{0}@{1}'.format("${c.other_repo.repo_name}", obj.text)
+            return '{0}@{1}'.format("${c.cs_repo.repo_name}", obj.text)
         },
         query: function(query){
           var key = 'cache2';
@@ -164,7 +164,7 @@
             query.callback(data);
           }else{
               $.ajax({
-                url: pyroutes.url('repo_refs_data', {'repo_name': '${c.other_repo.repo_name}'}),
+                url: pyroutes.url('repo_refs_data', {'repo_name': '${c.cs_repo.repo_name}'}),
                 data: {},
                 dataType: 'json',
                 type: 'GET',
@@ -197,7 +197,7 @@
             return;
         }
 
-        var compare_url = "${h.url('compare_url',repo_name=c.repo_name,org_ref_type='__other_ref_type__',org_ref_name='__org__',other_ref_type='__org_ref_type__',other_ref_name='__other__', other_repo=c.other_repo.repo_name)}";
+        var compare_url = "${h.url('compare_url',repo_name=c.repo_name,org_ref_type='__other_ref_type__',org_ref_name='__org__',other_ref_type='__org_ref_type__',other_ref_name='__other__', other_repo=c.cs_repo.repo_name)}";
         var u = compare_url.replace('__other_ref_type__',org.type)
                            .replace('__org__',org.text)
                            .replace('__org_ref_type__',other.type)
--- a/kallithea/templates/pullrequests/pullrequest.html	Thu Aug 21 23:46:55 2014 +0200
+++ b/kallithea/templates/pullrequests/pullrequest.html	Thu Aug 21 23:46:55 2014 +0200
@@ -56,7 +56,7 @@
                             <b>${_('Origin repository')}:</b> <span id="org_repo_desc">${c.db_repo.description.split('\n')[0]}</span>
                             </div>
                             <div>
-                            ${h.select('org_repo','',c.org_repos,class_='refs')}:${h.select('org_ref',c.default_org_ref,c.org_refs,class_='refs')}
+                            ${h.select('org_repo','',c.cs_repos,class_='refs')}:${h.select('org_ref',c.default_cs_ref,c.cs_refs,class_='refs')}
                             </div>
                             <div style="padding:5px 3px 3px 3px;">
                             <b>${_('Revision')}:</b> <span id="org_rev_span">-</span>
@@ -69,10 +69,10 @@
                         <div>
                             ## filled with JS
                             <div style="padding:5px 3px 3px 3px;">
-                            <b>${_('Destination repository')}:</b> <span id="other_repo_desc">${c.other_repo.description.split('\n')[0]}</span>
+                            <b>${_('Destination repository')}:</b> <span id="other_repo_desc">${c.a_repo.description.split('\n')[0]}</span>
                             </div>
                             <div>
-                            ${h.select('other_repo',c.other_repo.repo_name,c.other_repos,class_='refs')}:${h.select('other_ref',c.default_other_ref,c.other_refs,class_='refs')}
+                            ${h.select('other_repo',c.a_repo.repo_name,c.a_repos,class_='refs')}:${h.select('other_ref',c.default_a_ref,c.a_refs,class_='refs')}
                             </div>
                             <div style="padding:5px 3px 3px 3px;">
                             <b>${_('Revision')}:</b> <span id="other_rev_span">-</span>
@@ -99,7 +99,7 @@
               ## members goes here !
               <div>
                 <ul id="review_members" class="group_members">
-                %for member in [c.other_repo.user]:
+                %for member in [c.a_repo.user]:
                   <li id="reviewer_${member.user_id}">
                     <div class="reviewers_member">
                       <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(member.email, 14)}"/> </div>
--- a/kallithea/templates/pullrequests/pullrequest_show.html	Thu Aug 21 23:46:55 2014 +0200
+++ b/kallithea/templates/pullrequests/pullrequest_show.html	Thu Aug 21 23:46:55 2014 +0200
@@ -8,7 +8,7 @@
 </%def>
 
 <%def name="breadcrumbs_links()">
-    ${_('Pull request #%s from %s#%s') % (c.pull_request.pull_request_id, c.pull_request.org_repo.repo_name, c.org_branch_name)}
+    ${_('Pull request #%s from %s#%s') % (c.pull_request.pull_request_id, c.pull_request.org_repo.repo_name, c.cs_branch_name)}
 </%def>
 
 <%def name="page_nav()">
@@ -116,9 +116,9 @@
           </div>
           <div class="input">
             <div>
-              ${h.link_to_ref(c.pull_request.org_repo.repo_name, c.org_ref_type, c.org_ref_name, c.org_rev)}
-              %if c.org_ref_type != 'branch':
-                ${_('on')} ${h.link_to_ref(c.pull_request.org_repo.repo_name, 'branch', c.org_branch_name)}
+              ${h.link_to_ref(c.pull_request.org_repo.repo_name, c.cs_ref_type, c.cs_ref_name, c.cs_rev)}
+              %if c.cs_ref_type != 'branch':
+                ${_('on')} ${h.link_to_ref(c.pull_request.org_repo.repo_name, 'branch', c.cs_branch_name)}
               %endif
             </div>
           </div>
@@ -129,8 +129,8 @@
           </div>
           <div class="input">
               <div>
-              ${h.link_to_ref(c.pull_request.other_repo.repo_name, c.other_ref_type, c.other_ref_name)}
-              ## we don't know other rev - c.other_rev is ancestor and not necessarily on other_name_branch branch
+              ${h.link_to_ref(c.pull_request.other_repo.repo_name, c.a_ref_type, c.a_ref_name)}
+              ## we don't know other rev - c.a_rev is ancestor and not necessarily on other_name_branch branch
               </div>
           </div>
         </div>
@@ -185,7 +185,7 @@
                   %for cnt, cs in enumerate(reversed(c.available)):
                     <tr>
                     <td>${h.radio(name='updaterev', value=cs.raw_id)}</td>
-                    <td>${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.org_repo.repo_name,revision=cs.raw_id))}</td>
+                    <td>${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}</td>
                     <td><div class="message" style="white-space:normal; height:1.1em; max-width: 500px; padding:0">${h.urlify_commit(cs.message, c.repo_name)}</div></td>
                     </tr>
                   %endfor
@@ -261,7 +261,7 @@
 
               <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">
               ${_('Common ancestor')}:
-              ${h.link_to(h.short_id(c.other_rev),h.url('changeset_home',repo_name=c.other_repo.repo_name,revision=c.other_rev))}
+              ${h.link_to(h.short_id(c.a_rev),h.url('changeset_home',repo_name=c.a_repo.repo_name,revision=c.a_rev))}
               </div>
 
               ## FILES