Show More
@@ -40,6 +40,7 b' from rhodecode.lib.utils2 import safe_un' | |||
|
40 | 40 | |
|
41 | 41 | from rhodecode.lib.vcs.utils.hgcompat import discovery, localrepo, scmutil, \ |
|
42 | 42 | findcommonoutgoing |
|
43 | from rhodecode.lib.vcs.utils import safe_str | |
|
43 | 44 | |
|
44 | 45 | log = logging.getLogger(__name__) |
|
45 | 46 | |
@@ -174,12 +175,26 b' class PullRequestModel(BaseModel):' | |||
|
174 | 175 | changesets = [] |
|
175 | 176 | |
|
176 | 177 | if alias == 'hg': |
|
178 | # lookup up the exact node id | |
|
179 | _revset_predicates = { | |
|
180 | 'branch': 'branch', | |
|
181 | 'book': 'bookmark', | |
|
182 | 'tag': 'tag', | |
|
183 | 'rev': 'id', | |
|
184 | } | |
|
185 | org_rev_spec = "%s('%s')" % (_revset_predicates[org_ref[0]], | |
|
186 | safe_str(org_ref[1])) | |
|
187 | org_rev = scmutil.revsingle(org_repo._repo, | |
|
188 | org_rev_spec) | |
|
189 | other_rev_spec = "%s('%s')" % (_revset_predicates[other_ref[0]], | |
|
190 | safe_str(other_ref[1])) | |
|
191 | other_rev = scmutil.revsingle(other_repo._repo, other_rev_spec) | |
|
177 | 192 | |
|
178 | 193 | #case two independent repos |
|
179 | 194 | if org_repo != other_repo: |
|
180 | 195 | revs = [ |
|
181 | 196 | org_repo._repo.lookup(org_ref[1]), |
|
182 | org_repo._repo.lookup(other_ref[1]), | |
|
197 | org_repo._repo.lookup(other_ref[1]), # lookup up in the wrong repo! | |
|
183 | 198 | ] |
|
184 | 199 | |
|
185 | 200 | obj = findcommonoutgoing(org_repo._repo, |
@@ -200,20 +215,9 b' class PullRequestModel(BaseModel):' | |||
|
200 | 215 | |
|
201 | 216 | #no remote compare do it on the same repository |
|
202 | 217 | else: |
|
203 | _revset_predicates = { | |
|
204 |
|
|
|
205 | 'book': 'bookmark', | |
|
206 | 'tag': 'tag', | |
|
207 | 'rev': 'id', | |
|
208 | } | |
|
209 | ||
|
210 | revs = [ | |
|
211 | "ancestors(%s('%s')) and not ancestors(%s('%s'))" % ( | |
|
212 | _revset_predicates[other_ref[0]], other_ref[1], | |
|
213 | _revset_predicates[org_ref[0]], org_ref[1], | |
|
214 | ) | |
|
215 | ] | |
|
216 | ||
|
218 | revs = ["ancestors(id('%s')) and not ancestors(id('%s'))" % | |
|
219 | (other_rev, org_rev)] | |
|
220 | ||
|
217 | 221 | out = scmutil.revrange(org_repo._repo, revs) |
|
218 | 222 | for cs in (out): |
|
219 | 223 | changesets.append(org_repo.get_changeset(cs)) |
@@ -232,7 +236,7 b' class PullRequestModel(BaseModel):' | |||
|
232 | 236 | |
|
233 | 237 | def get_compare_data(self, org_repo, org_ref, other_repo, other_ref): |
|
234 | 238 | """ |
|
235 |
Returns incom |
|
|
239 | Returns incoming changesets for mercurial repositories | |
|
236 | 240 | |
|
237 | 241 | :param org_repo: |
|
238 | 242 | :type org_repo: |
General Comments 0
You need to be logged in to leave comments.
Login now