Mercurial > public > mercurial-scm > hg-stable
diff mercurial/context.py @ 14669:2d2604adfdd6
context: add a match builder method
This is groundwork for matching against filesets in contexts
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 18 Jun 2011 16:52:51 -0500 |
parents | f3a40fd7008c |
children | 1c151b963254 |
line wrap: on
line diff
--- a/mercurial/context.py Fri Jun 17 18:24:54 2011 -0300 +++ b/mercurial/context.py Sat Jun 18 16:52:51 2011 -0500 @@ -8,6 +8,7 @@ from node import nullid, nullrev, short, hex from i18n import _ import ancestor, bdiff, error, util, scmutil, subrepo, patch, encoding +import match as matchmod import os, errno, stat propertycache = util.propertycache @@ -208,6 +209,11 @@ def sub(self, path): return subrepo.subrepo(self, path) + def match(self, pats=[], include=None, exclude=None, default='glob'): + r = self._repo + return matchmod.match(r.root, r.getcwd(), pats, + include, exclude, default, auditor=r.auditor) + def diff(self, ctx2=None, match=None, **opts): """Returns a diff generator for the given contexts and matcher""" if ctx2 is None: