Mercurial > hg
comparison mercurial/match.py @ 44002:d9d78e70149a
tests: fix failing doctest in match.py by adding dummy auditor
It was failing with "OSError: [Errno 13] Permission denied:
'/root/sub'". It has been failing since 8b1a9ba375e5 (match: make sure
`root` argument is always an absolute path (API), 2019-12-13). I don't
know why I didn't notice it before sending that patch.
Differential Revision: https://phab.mercurial-scm.org/D7731
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 27 Dec 2019 09:55:35 -0800 |
parents | 8a81fa44f7bb |
children | e685fac56693 |
comparison
equal
deleted
inserted
replaced
44001:faf00e30b63f | 44002:d9d78e70149a |
---|---|
943 """Adapt a matcher to work on a subdirectory only. | 943 """Adapt a matcher to work on a subdirectory only. |
944 | 944 |
945 The paths are remapped to remove/insert the path as needed: | 945 The paths are remapped to remove/insert the path as needed: |
946 | 946 |
947 >>> from . import pycompat | 947 >>> from . import pycompat |
948 >>> m1 = match(util.localpath(b'/root'), b'', [b'a.txt', b'sub/b.txt']) | 948 >>> m1 = match(util.localpath(b'/root'), b'', [b'a.txt', b'sub/b.txt'], auditor=lambda name: None) |
949 >>> m2 = subdirmatcher(b'sub', m1) | 949 >>> m2 = subdirmatcher(b'sub', m1) |
950 >>> m2(b'a.txt') | 950 >>> m2(b'a.txt') |
951 False | 951 False |
952 >>> m2(b'b.txt') | 952 >>> m2(b'b.txt') |
953 True | 953 True |