mercurial/revset.py
changeset 25149 3f0744eeaeaf
parent 25146 f542a2c89b60
child 25191 08d1ef09ed37
equal deleted inserted replaced
25148:3b5cd6f13dcc 25149:3f0744eeaeaf
  1119     # i18n: "keyword" is a keyword
  1119     # i18n: "keyword" is a keyword
  1120     kw = encoding.lower(getstring(x, _("keyword requires a string")))
  1120     kw = encoding.lower(getstring(x, _("keyword requires a string")))
  1121 
  1121 
  1122     def matches(r):
  1122     def matches(r):
  1123         c = repo[r]
  1123         c = repo[r]
  1124         return util.any(kw in encoding.lower(t) for t in c.files() + [c.user(),
  1124         return any(kw in encoding.lower(t) for t in c.files() + [c.user(),
  1125             c.description()])
  1125             c.description()])
  1126 
  1126 
  1127     return subset.filter(matches)
  1127     return subset.filter(matches)
  1128 
  1128 
  1129 def limit(repo, subset, x):
  1129 def limit(repo, subset, x):
  1777 
  1777 
  1778         if len(args) == 0:
  1778         if len(args) == 0:
  1779             return s.added or s.modified or s.removed
  1779             return s.added or s.modified or s.removed
  1780 
  1780 
  1781         if s.added:
  1781         if s.added:
  1782             return util.any(submatches(c.substate.keys()))
  1782             return any(submatches(c.substate.keys()))
  1783 
  1783 
  1784         if s.modified:
  1784         if s.modified:
  1785             subs = set(c.p1().substate.keys())
  1785             subs = set(c.p1().substate.keys())
  1786             subs.update(c.substate.keys())
  1786             subs.update(c.substate.keys())
  1787 
  1787 
  1788             for path in submatches(subs):
  1788             for path in submatches(subs):
  1789                 if c.p1().substate.get(path) != c.substate.get(path):
  1789                 if c.p1().substate.get(path) != c.substate.get(path):
  1790                     return True
  1790                     return True
  1791 
  1791 
  1792         if s.removed:
  1792         if s.removed:
  1793             return util.any(submatches(c.p1().substate.keys()))
  1793             return any(submatches(c.p1().substate.keys()))
  1794 
  1794 
  1795         return False
  1795         return False
  1796 
  1796 
  1797     return subset.filter(matches)
  1797     return subset.filter(matches)
  1798 
  1798