##// END OF EJS Templates
revset: added lazyset implementation to checkstatus...
Lucas Moscovicz -
r20457:ed7b6748 default
parent child Browse files
Show More
@@ -464,35 +464,35 b' def bundle(repo, subset, x):'
464 return subset & bundlerevs
464 return subset & bundlerevs
465
465
466 def checkstatus(repo, subset, pat, field):
466 def checkstatus(repo, subset, pat, field):
467 m = None
468 s = []
469 hasset = matchmod.patkind(pat) == 'set'
467 hasset = matchmod.patkind(pat) == 'set'
470 fname = None
468
471 for r in subset:
469 def matches(x):
472 c = repo[r]
470 m = None
471 fname = None
472 c = repo[x]
473 if not m or hasset:
473 if not m or hasset:
474 m = matchmod.match(repo.root, repo.getcwd(), [pat], ctx=c)
474 m = matchmod.match(repo.root, repo.getcwd(), [pat], ctx=c)
475 if not m.anypats() and len(m.files()) == 1:
475 if not m.anypats() and len(m.files()) == 1:
476 fname = m.files()[0]
476 fname = m.files()[0]
477 if fname is not None:
477 if fname is not None:
478 if fname not in c.files():
478 if fname not in c.files():
479 continue
479 return False
480 else:
480 else:
481 for f in c.files():
481 for f in c.files():
482 if m(f):
482 if m(f):
483 break
483 break
484 else:
484 else:
485 continue
485 return False
486 files = repo.status(c.p1().node(), c.node())[field]
486 files = repo.status(c.p1().node(), c.node())[field]
487 if fname is not None:
487 if fname is not None:
488 if fname in files:
488 if fname in files:
489 s.append(r)
489 return True
490 else:
490 else:
491 for f in files:
491 for f in files:
492 if m(f):
492 if m(f):
493 s.append(r)
493 return True
494 break
494
495 return baseset(s)
495 return lazyset(subset, matches)
496
496
497 def _children(repo, narrow, parentset):
497 def _children(repo, narrow, parentset):
498 cs = set()
498 cs = set()
General Comments 0
You need to be logged in to leave comments. Login now