##// END OF EJS Templates
revset: leverage orset() to flatten ancestor() arguments...
Yuya Nishihara -
r38508:626d29c6 default
parent child Browse files
Show More
@@ -203,6 +203,8 b' def _orsetlist(repo, subset, xs, order):'
203 203
204 204 def orset(repo, subset, x, order):
205 205 xs = getlist(x)
206 if not xs:
207 return baseset()
206 208 if order == followorder:
207 209 # slow path to take the subset order
208 210 return subset & _orsetlist(repo, fullreposet(repo), xs, anyorder)
@@ -309,17 +311,12 b' def ancestor(repo, subset, x):'
309 311 Will return empty list when passed no args.
310 312 Greatest common ancestor of a single changeset is that changeset.
311 313 """
312 l = getlist(x)
313 rl = fullreposet(repo)
314 314 anc = None
315
316 # (getset(repo, rl, i) for i in l) generates a list of lists
317 for revs in (getset(repo, rl, i) for i in l):
318 for r in revs:
319 if anc is None:
320 anc = repo[r]
321 else:
322 anc = anc.ancestor(repo[r])
315 for r in orset(repo, fullreposet(repo), x, order=anyorder):
316 if anc is None:
317 anc = repo[r]
318 else:
319 anc = anc.ancestor(repo[r])
323 320
324 321 if anc is not None and anc.rev() in subset:
325 322 return baseset([anc.rev()])
General Comments 0
You need to be logged in to leave comments. Login now