Mercurial > hg
comparison mercurial/revset.py @ 43592:61d7bca16dff
revset: simplify checkstatus() by using any()
Differential Revision: https://phab.mercurial-scm.org/D7179
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 30 Oct 2019 00:00:21 -0700 |
parents | 45d123d84011 |
children | d212d657ba0e |
comparison
equal
deleted
inserted
replaced
43591:b56c6647f65e | 43592:61d7bca16dff |
---|---|
687 fname = m.files()[0] | 687 fname = m.files()[0] |
688 if fname is not None: | 688 if fname is not None: |
689 if fname not in c.files(): | 689 if fname not in c.files(): |
690 return False | 690 return False |
691 else: | 691 else: |
692 for f in c.files(): | 692 if not any(m(f) for f in c.files()): |
693 if m(f): | |
694 break | |
695 else: | |
696 return False | 693 return False |
697 files = repo.status(c.p1().node(), c.node())[field] | 694 files = repo.status(c.p1().node(), c.node())[field] |
698 if fname is not None: | 695 if fname is not None: |
699 if fname in files: | 696 if fname in files: |
700 return True | 697 return True |
701 else: | 698 else: |
702 for f in files: | 699 if any(m(f) for f in files): |
703 if m(f): | 700 return True |
704 return True | |
705 | 701 |
706 return subset.filter(matches, condrepr=(b'<status[%r] %r>', field, pat)) | 702 return subset.filter(matches, condrepr=(b'<status[%r] %r>', field, pat)) |
707 | 703 |
708 | 704 |
709 def _children(repo, subset, parentset): | 705 def _children(repo, subset, parentset): |