712 """Options to configure a set of revisions and file matcher factory |
711 """Options to configure a set of revisions and file matcher factory |
713 to scan revision/file history |
712 to scan revision/file history |
714 """ |
713 """ |
715 |
714 |
716 # raw command-line parameters, which a matcher will be built from |
715 # raw command-line parameters, which a matcher will be built from |
717 pats = attr.ib() # type: List[bytes] |
716 pats = attr.ib() |
718 opts = attr.ib() # type: Dict[bytes, Any] |
717 opts = attr.ib() |
719 |
718 |
720 # a list of revset expressions to be traversed; if follow, it specifies |
719 # a list of revset expressions to be traversed; if follow, it specifies |
721 # the start revisions |
720 # the start revisions |
722 revspec = attr.ib() # type: List[bytes] |
721 revspec = attr.ib() |
723 |
722 |
724 # miscellaneous queries to filter revisions (see "hg help log" for details) |
723 # miscellaneous queries to filter revisions (see "hg help log" for details) |
725 bookmarks = attr.ib(default=attr.Factory(list)) # type: List[bytes] |
724 bookmarks = attr.ib(default=attr.Factory(list)) |
726 branches = attr.ib(default=attr.Factory(list)) # type: List[bytes] |
725 branches = attr.ib(default=attr.Factory(list)) |
727 date = attr.ib(default=None) # type: Optional[bytes] |
726 date = attr.ib(default=None) |
728 keywords = attr.ib(default=attr.Factory(list)) # type: List[bytes] |
727 keywords = attr.ib(default=attr.Factory(list)) |
729 no_merges = attr.ib(default=False) # type: bool |
728 no_merges = attr.ib(default=False) |
730 only_merges = attr.ib(default=False) # type: bool |
729 only_merges = attr.ib(default=False) |
731 prune_ancestors = attr.ib(default=attr.Factory(list)) # type: List[bytes] |
730 prune_ancestors = attr.ib(default=attr.Factory(list)) |
732 users = attr.ib(default=attr.Factory(list)) # type: List[bytes] |
731 users = attr.ib(default=attr.Factory(list)) |
733 |
732 |
734 # miscellaneous matcher arguments |
733 # miscellaneous matcher arguments |
735 include_pats = attr.ib(default=attr.Factory(list)) # type: List[bytes] |
734 include_pats = attr.ib(default=attr.Factory(list)) |
736 exclude_pats = attr.ib(default=attr.Factory(list)) # type: List[bytes] |
735 exclude_pats = attr.ib(default=attr.Factory(list)) |
737 |
736 |
738 # 0: no follow, 1: follow first, 2: follow both parents |
737 # 0: no follow, 1: follow first, 2: follow both parents |
739 follow = attr.ib(default=0) # type: int |
738 follow = attr.ib(default=0) |
740 |
739 |
741 # do not attempt filelog-based traversal, which may be fast but cannot |
740 # do not attempt filelog-based traversal, which may be fast but cannot |
742 # include revisions where files were removed |
741 # include revisions where files were removed |
743 force_changelog_traversal = attr.ib(default=False) # type: bool |
742 force_changelog_traversal = attr.ib(default=False) |
744 |
743 |
745 # filter revisions by file patterns, which should be disabled only if |
744 # filter revisions by file patterns, which should be disabled only if |
746 # you want to include revisions where files were unmodified |
745 # you want to include revisions where files were unmodified |
747 filter_revisions_by_pats = attr.ib(default=True) # type: bool |
746 filter_revisions_by_pats = attr.ib(default=True) |
748 |
747 |
749 # sort revisions prior to traversal: 'desc', 'topo', or None |
748 # sort revisions prior to traversal: 'desc', 'topo', or None |
750 sort_revisions = attr.ib(default=None) # type: Optional[bytes] |
749 sort_revisions = attr.ib(default=None) |
751 |
750 |
752 # limit number of changes displayed; None means unlimited |
751 # limit number of changes displayed; None means unlimited |
753 limit = attr.ib(default=None) # type: Optional[int] |
752 limit = attr.ib(default=None) |
754 |
753 |
755 |
754 |
756 def parseopts(ui, pats, opts): |
755 def parseopts(ui, pats, opts): |
757 # type: (Any, Sequence[bytes], Dict[bytes, Any]) -> walkopts |
756 # type: (Any, Sequence[bytes], Dict[bytes, Any]) -> walkopts |
758 """Parse log command options into walkopts |
757 """Parse log command options into walkopts |