##// END OF EJS Templates
revset: avoid recalculating filesets...
Matt Mackall -
r23061:f2aeff8a stable
parent child Browse files
Show More
@@ -899,7 +899,6 b' def _matchfiles(repo, subset, x):'
899 # i18n: "_matchfiles" is a keyword
899 # i18n: "_matchfiles" is a keyword
900 l = getargs(x, 1, -1, _("_matchfiles requires at least one argument"))
900 l = getargs(x, 1, -1, _("_matchfiles requires at least one argument"))
901 pats, inc, exc = [], [], []
901 pats, inc, exc = [], [], []
902 hasset = False
903 rev, default = None, None
902 rev, default = None, None
904 for arg in l:
903 for arg in l:
905 # i18n: "_matchfiles" is a keyword
904 # i18n: "_matchfiles" is a keyword
@@ -926,21 +925,14 b' def _matchfiles(repo, subset, x):'
926 else:
925 else:
927 # i18n: "_matchfiles" is a keyword
926 # i18n: "_matchfiles" is a keyword
928 raise error.ParseError(_('invalid _matchfiles prefix: %s') % prefix)
927 raise error.ParseError(_('invalid _matchfiles prefix: %s') % prefix)
929 if not hasset and matchmod.patkind(value) == 'set':
930 hasset = True
931 if not default:
928 if not default:
932 default = 'glob'
929 default = 'glob'
933
930
931 m = matchmod.match(repo.root, repo.getcwd(), pats, include=inc,
932 exclude=exc, ctx=repo[rev], default=default)
933
934 def matches(x):
934 def matches(x):
935 m = None
935 for f in repo[x].files():
936 c = repo[x]
937 if not m or (hasset and rev is None):
938 ctx = c
939 if rev is not None:
940 ctx = repo[rev or None]
941 m = matchmod.match(repo.root, repo.getcwd(), pats, include=inc,
942 exclude=exc, ctx=ctx, default=default)
943 for f in c.files():
944 if m(f):
936 if m(f):
945 return True
937 return True
946 return False
938 return False
General Comments 0
You need to be logged in to leave comments. Login now