##// END OF EJS Templates
context: add a match builder method...
Matt Mackall -
r14669:2d2604ad default
parent child Browse files
Show More
@@ -8,6 +8,7 b''
8 8 from node import nullid, nullrev, short, hex
9 9 from i18n import _
10 10 import ancestor, bdiff, error, util, scmutil, subrepo, patch, encoding
11 import match as matchmod
11 12 import os, errno, stat
12 13
13 14 propertycache = util.propertycache
@@ -208,6 +209,11 b' class changectx(object):'
208 209 def sub(self, path):
209 210 return subrepo.subrepo(self, path)
210 211
212 def match(self, pats=[], include=None, exclude=None, default='glob'):
213 r = self._repo
214 return matchmod.match(r.root, r.getcwd(), pats,
215 include, exclude, default, auditor=r.auditor)
216
211 217 def diff(self, ctx2=None, match=None, **opts):
212 218 """Returns a diff generator for the given contexts and matcher"""
213 219 if ctx2 is None:
@@ -563,9 +563,8 b' def match(repo, pats=[], opts={}, globbe'
563 563 pats = []
564 564 if not globbed and default == 'relpath':
565 565 pats = expandpats(pats or [])
566 m = matchmod.match(repo.root, repo.getcwd(), pats,
567 opts.get('include'), opts.get('exclude'), default,
568 auditor=repo.auditor)
566 m = repo[None].match(pats, opts.get('include'), opts.get('exclude'),
567 default)
569 568 def badfn(f, msg):
570 569 repo.ui.warn("%s: %s\n" % (m.rel(f), msg))
571 570 m.bad = badfn
General Comments 0
You need to be logged in to leave comments. Login now