##// 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 def orset(repo, subset, x, order):
204 def orset(repo, subset, x, order):
205 xs = getlist(x)
205 xs = getlist(x)
206 if not xs:
207 return baseset()
206 if order == followorder:
208 if order == followorder:
207 # slow path to take the subset order
209 # slow path to take the subset order
208 return subset & _orsetlist(repo, fullreposet(repo), xs, anyorder)
210 return subset & _orsetlist(repo, fullreposet(repo), xs, anyorder)
@@ -309,13 +311,8 b' def ancestor(repo, subset, x):'
309 Will return empty list when passed no args.
311 Will return empty list when passed no args.
310 Greatest common ancestor of a single changeset is that changeset.
312 Greatest common ancestor of a single changeset is that changeset.
311 """
313 """
312 l = getlist(x)
313 rl = fullreposet(repo)
314 anc = None
314 anc = None
315
315 for r in orset(repo, fullreposet(repo), x, order=anyorder):
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:
316 if anc is None:
320 anc = repo[r]
317 anc = repo[r]
321 else:
318 else:
General Comments 0
You need to be logged in to leave comments. Login now