changeset 4923:422667bdb47b

pullrequests: fix updates for PRs between same branch on different repositories
author Mads Kiilerich <madski@unity3d.com>
date Thu, 12 Mar 2015 15:34:24 +0100
parents 5e66d3ec9880
children 7c952ea3d7b3
files kallithea/controllers/pullrequests.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/pullrequests.py	Sat Mar 14 21:51:33 2015 +0100
+++ b/kallithea/controllers/pullrequests.py	Thu Mar 12 15:34:24 2015 +0100
@@ -36,6 +36,7 @@
 from pylons.controllers.util import redirect
 from pylons.i18n.translation import _
 
+from kallithea.lib.vcs.utils.hgcompat import unionrepo
 from kallithea.lib.compat import json
 from kallithea.lib.base import BaseRepoController, render
 from kallithea.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator,\
@@ -582,8 +583,14 @@
                 if len(avail_revs) > 1: # more than just revs[0]
                     # also show changesets that not are descendants but would be merged in
                     targethead = other_scm_instance.get_changeset(c.a_branch_name).raw_id
-                    show = set(org_scm_instance._repo.revs('::%ld & !::%s & !::%s',
-                                                           avail_revs, revs[0], targethead))
+                    if org_scm_instance.path != other_scm_instance.path:
+                        hgrepo = unionrepo.unionrepository(org_scm_instance.baseui,
+                                                           other_scm_instance.path,
+                                                           org_scm_instance.path)
+                    else:
+                        hgrepo = org_scm_instance._repo
+                    show = set(hgrepo.revs('::%ld & !::%s & !::%s',
+                                           avail_revs, revs[0], targethead))
                     c.update_msg = _('This pull request can be updated with changes on %s:') % c.cs_branch_name
                 else:
                     show = set()