Show More
@@ -24,22 +24,20 b'' | |||
|
24 | 24 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
25 | 25 | |
|
26 | 26 | import logging |
|
27 | import binascii | |
|
28 | 27 | import datetime |
|
29 | 28 | import re |
|
30 | 29 | |
|
31 | 30 | from pylons.i18n.translation import _ |
|
32 | 31 | |
|
33 | 32 | from rhodecode.model.meta import Session |
|
34 | from rhodecode.lib import helpers as h | |
|
33 | from rhodecode.lib import helpers as h, unionrepo | |
|
35 | 34 | from rhodecode.model import BaseModel |
|
36 | 35 | from rhodecode.model.db import PullRequest, PullRequestReviewers, Notification,\ |
|
37 | 36 | ChangesetStatus |
|
38 | 37 | from rhodecode.model.notification import NotificationModel |
|
39 | 38 | from rhodecode.lib.utils2 import safe_unicode |
|
40 | 39 | |
|
41 |
from rhodecode.lib.vcs.utils.hgcompat import |
|
|
42 | findcommonoutgoing | |
|
40 | from rhodecode.lib.vcs.utils.hgcompat import scmutil | |
|
43 | 41 | from rhodecode.lib.vcs.utils import safe_str |
|
44 | 42 | |
|
45 | 43 | log = logging.getLogger(__name__) |
@@ -192,35 +190,21 b' class PullRequestModel(BaseModel):' | |||
|
192 | 190 | |
|
193 | 191 | #case two independent repos |
|
194 | 192 | if org_repo != other_repo: |
|
195 | revs = [ | |
|
196 | org_repo._repo.lookup(org_ref[1]), | |
|
197 | org_repo._repo.lookup(other_ref[1]), # lookup up in the wrong repo! | |
|
198 | ] | |
|
199 | ||
|
200 | obj = findcommonoutgoing(org_repo._repo, | |
|
201 | localrepo.locallegacypeer(other_repo._repo.local()), | |
|
202 | revs, | |
|
203 | force=True) | |
|
204 | revs = obj.missing | |
|
205 | ||
|
206 | for cs in map(binascii.hexlify, revs): | |
|
207 | _cs = org_repo.get_changeset(cs) | |
|
208 | changesets.append(_cs) | |
|
209 | # in case we have revisions filter out the ones not in given range | |
|
210 | if org_ref[0] == 'rev' and other_ref[0] == 'rev': | |
|
211 | revs = [x.raw_id for x in changesets] | |
|
212 | start = org_ref[1] | |
|
213 | stop = other_ref[1] | |
|
214 | changesets = changesets[revs.index(start):revs.index(stop) + 1] | |
|
193 | hgrepo = unionrepo.unionrepository(org_repo.baseui, | |
|
194 | org_repo.path, | |
|
195 | other_repo.path) | |
|
196 | revs = ["ancestors(id('%s')) and not ancestors(id('%s'))" % | |
|
197 | (org_rev, other_rev)] | |
|
215 | 198 | |
|
216 | 199 | #no remote compare do it on the same repository |
|
217 | 200 | else: |
|
201 | hgrepo = org_repo._repo | |
|
218 | 202 | revs = ["ancestors(id('%s')) and not ancestors(id('%s'))" % |
|
219 | 203 | (other_rev, org_rev)] |
|
220 | 204 | |
|
221 |
|
|
|
222 |
|
|
|
223 |
|
|
|
205 | out = scmutil.revrange(hgrepo, revs) | |
|
206 | for cs in (out): | |
|
207 | changesets.append(org_repo.get_changeset(cs)) | |
|
224 | 208 | |
|
225 | 209 | elif alias == 'git': |
|
226 | 210 | assert org_repo == other_repo, (org_repo, other_repo) # no git support for different repos |
General Comments 0
You need to be logged in to leave comments.
Login now