--- a/tests/test-manifest.py Fri Dec 27 16:47:47 2019 +0100
+++ b/tests/test-manifest.py Thu Dec 26 16:45:56 2019 -0500
@@ -9,6 +9,7 @@
from mercurial import (
manifest as manifestmod,
match as matchmod,
+ util,
)
EMTPY_MANIFEST = b''
@@ -169,7 +170,7 @@
m[b'foo'] = want + b'+'
self.assertEqual(want, m[b'foo'])
# make sure the suffix survives a copy
- match = matchmod.match(b'/repo', b'', [b're:foo'])
+ match = matchmod.match(util.localpath(b'/repo'), b'', [b're:foo'])
m2 = m.matches(match)
self.assertEqual(want, m2[b'foo'])
self.assertEqual(1, len(m2))
@@ -186,7 +187,7 @@
def testMatchException(self):
m = self.parsemanifest(A_SHORT_MANIFEST)
- match = matchmod.match(b'/repo', b'', [b're:.*'])
+ match = matchmod.match(util.localpath(b'/repo'), b'', [b're:.*'])
def filt(path):
if path == b'foo':
@@ -328,7 +329,9 @@
actually exist.'''
m = self.parsemanifest(A_DEEPER_MANIFEST)
- match = matchmod.match(b'/repo', b'', [b'a/f'], default=b'relpath')
+ match = matchmod.match(
+ util.localpath(b'/repo'), b'', [b'a/f'], default=b'relpath'
+ )
m2 = m.matches(match)
self.assertEqual([], m2.keys())
@@ -348,7 +351,7 @@
'''Tests matches() for what should be a full match.'''
m = self.parsemanifest(A_DEEPER_MANIFEST)
- match = matchmod.match(b'/repo', b'', [b''])
+ match = matchmod.match(util.localpath(b'/repo'), b'', [b''])
m2 = m.matches(match)
self.assertEqual(m.keys(), m2.keys())
@@ -358,7 +361,9 @@
match against all files within said directory.'''
m = self.parsemanifest(A_DEEPER_MANIFEST)
- match = matchmod.match(b'/repo', b'', [b'a/b'], default=b'relpath')
+ match = matchmod.match(
+ util.localpath(b'/repo'), b'', [b'a/b'], default=b'relpath'
+ )
m2 = m.matches(match)
self.assertEqual(
@@ -392,7 +397,9 @@
when not in the root directory.'''
m = self.parsemanifest(A_DEEPER_MANIFEST)
- match = matchmod.match(b'/repo', b'a/b', [b'.'], default=b'relpath')
+ match = matchmod.match(
+ util.localpath(b'/repo'), b'a/b', [b'.'], default=b'relpath'
+ )
m2 = m.matches(match)
self.assertEqual(
@@ -415,7 +422,7 @@
deeper than the specified directory.'''
m = self.parsemanifest(A_DEEPER_MANIFEST)
- match = matchmod.match(b'/repo', b'', [b'a/b/*/*.txt'])
+ match = matchmod.match(util.localpath(b'/repo'), b'', [b'a/b/*/*.txt'])
m2 = m.matches(match)
self.assertEqual(
@@ -467,7 +474,7 @@
sorted(dirs),
)
- match = matchmod.match(b'/repo', b'', [b'path:a/b/'])
+ match = matchmod.match(util.localpath(b'/repo'), b'', [b'path:a/b/'])
dirs = [s._dir for s in m.walksubtrees(matcher=match)]
self.assertEqual(sorted([b'a/b/', b'a/b/c/', b'a/b/d/']), sorted(dirs))