From b31ce422e22d23d0f712a8d6c9faaa376fcf9a0c Mon Sep 17 00:00:00 2001 From: Martijn Pieters Date: Mon, 16 Apr 2018 12:30:35 -0700 Subject: [PATCH] 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 --- hgext/fbsparse.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hgext/fbsparse.py b/hgext/fbsparse.py index 95d95ce669..56ef30ebd8 100644 --- a/hgext/fbsparse.py +++ b/hgext/fbsparse.py @@ -1902,6 +1902,10 @@ class forceincludematcher(matchmod.basematcher): def __call__(self, value): return value in self._includes or self._matcher(value) + def __repr__(self): + return '' % ( + self._matcher, self._includes) + def visitdir(self, dir): if any(True for path in self._includes if path.startswith(dir)): return True @@ -1929,6 +1933,9 @@ class negatematcher(matchmod.basematcher): def __call__(self, value): return not self._matcher(value) + def __repr__(self): + return '' % self._matcher + def hash(self): sha1 = hashlib.sha1() sha1.update('negate')