mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
sparse: provide sensible __repr__ strings for the custom matchers.
Summary: These matchers provide better values than the default now provided by mercurial.match.basematcher. Reviewed By: quark-zju Differential Revision: D7635868 fbshipit-source-id: c826390b3a5e3a2da897eeb54be22850e14403f6
This commit is contained in:
parent
914d474bbf
commit
b31ce422e2
@ -1902,6 +1902,10 @@ class forceincludematcher(matchmod.basematcher):
|
|||||||
def __call__(self, value):
|
def __call__(self, value):
|
||||||
return value in self._includes or self._matcher(value)
|
return value in self._includes or self._matcher(value)
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return '<forceincludematcher matcher=%r includes=%r>' % (
|
||||||
|
self._matcher, self._includes)
|
||||||
|
|
||||||
def visitdir(self, dir):
|
def visitdir(self, dir):
|
||||||
if any(True for path in self._includes if path.startswith(dir)):
|
if any(True for path in self._includes if path.startswith(dir)):
|
||||||
return True
|
return True
|
||||||
@ -1929,6 +1933,9 @@ class negatematcher(matchmod.basematcher):
|
|||||||
def __call__(self, value):
|
def __call__(self, value):
|
||||||
return not self._matcher(value)
|
return not self._matcher(value)
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return '<negatematcher matcher=%r>' % self._matcher
|
||||||
|
|
||||||
def hash(self):
|
def hash(self):
|
||||||
sha1 = hashlib.sha1()
|
sha1 = hashlib.sha1()
|
||||||
sha1.update('negate')
|
sha1.update('negate')
|
||||||
|
Loading…
Reference in New Issue
Block a user