##// END OF EJS Templates
pull requeset: move stuff around, preparing for next change...
Mads Kiilerich -
r3301:3c91ec44 beta
parent child Browse files
Show More
@@ -40,6 +40,7 from rhodecode.lib.utils2 import safe_un
40
40
41 from rhodecode.lib.vcs.utils.hgcompat import discovery, localrepo, scmutil, \
41 from rhodecode.lib.vcs.utils.hgcompat import discovery, localrepo, scmutil, \
42 findcommonoutgoing
42 findcommonoutgoing
43 from rhodecode.lib.vcs.utils import safe_str
43
44
44 log = logging.getLogger(__name__)
45 log = logging.getLogger(__name__)
45
46
@@ -174,12 +175,26 class PullRequestModel(BaseModel):
174 changesets = []
175 changesets = []
175
176
176 if alias == 'hg':
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 #case two independent repos
193 #case two independent repos
179 if org_repo != other_repo:
194 if org_repo != other_repo:
180 revs = [
195 revs = [
181 org_repo._repo.lookup(org_ref[1]),
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 obj = findcommonoutgoing(org_repo._repo,
200 obj = findcommonoutgoing(org_repo._repo,
@@ -200,19 +215,8 class PullRequestModel(BaseModel):
200
215
201 #no remote compare do it on the same repository
216 #no remote compare do it on the same repository
202 else:
217 else:
203 _revset_predicates = {
218 revs = ["ancestors(id('%s')) and not ancestors(id('%s'))" %
204 'branch': 'branch',
219 (other_rev, org_rev)]
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
220
217 out = scmutil.revrange(org_repo._repo, revs)
221 out = scmutil.revrange(org_repo._repo, revs)
218 for cs in (out):
222 for cs in (out):
@@ -232,7 +236,7 class PullRequestModel(BaseModel):
232
236
233 def get_compare_data(self, org_repo, org_ref, other_repo, other_ref):
237 def get_compare_data(self, org_repo, org_ref, other_repo, other_ref):
234 """
238 """
235 Returns incomming changesets for mercurial repositories
239 Returns incoming changesets for mercurial repositories
236
240
237 :param org_repo:
241 :param org_repo:
238 :type org_repo:
242 :type org_repo:
General Comments 0
You need to be logged in to leave comments. Login now