##// END OF EJS Templates
lfs: fix various signature mismatches for vfs subclasses...
Matt Harbison -
r52774:d6288776 default
parent child Browse files
Show More
@@ -15,6 +15,10 import os
15 import re
15 import re
16 import socket
16 import socket
17
17
18 from typing import (
19 Optional,
20 )
21
18 from mercurial.i18n import _
22 from mercurial.i18n import _
19 from mercurial.node import hex
23 from mercurial.node import hex
20
24
@@ -42,11 +46,11 from ..largefiles import lfutil
42
46
43
47
44 class lfsvfs(vfsmod.vfs):
48 class lfsvfs(vfsmod.vfs):
45 def join(self, path):
49 def join(self, path: Optional[bytes], *insidef: bytes) -> bytes:
46 """split the path at first two characters, like: XX/XXXXX..."""
50 """split the path at first two characters, like: XX/XXXXX..."""
47 if not _lfsre.match(path):
51 if not _lfsre.match(path):
48 raise error.ProgrammingError(b'unexpected lfs path: %s' % path)
52 raise error.ProgrammingError(b'unexpected lfs path: %s' % path)
49 return super(lfsvfs, self).join(path[0:2], path[2:])
53 return super(lfsvfs, self).join(path[0:2], path[2:], *insidef)
50
54
51 def walk(self, path=None, onerror=None):
55 def walk(self, path=None, onerror=None):
52 """Yield (dirpath, [], oids) tuple for blobs under path
56 """Yield (dirpath, [], oids) tuple for blobs under path
@@ -77,7 +81,7 class nullvfs(lfsvfs):
77 def __init__(self):
81 def __init__(self):
78 pass
82 pass
79
83
80 def exists(self, oid):
84 def exists(self, path: Optional[bytes] = None) -> bool:
81 return False
85 return False
82
86
83 def read(self, oid):
87 def read(self, oid):
@@ -93,8 +97,8 class nullvfs(lfsvfs):
93 def walk(self, path=None, onerror=None):
97 def walk(self, path=None, onerror=None):
94 return (b'', [], [])
98 return (b'', [], [])
95
99
96 def write(self, oid, data):
100 def write(self, *args, **kwargs) -> int:
97 pass
101 return 0
98
102
99
103
100 class lfsuploadfile(httpconnectionmod.httpsendfile):
104 class lfsuploadfile(httpconnectionmod.httpsendfile):
General Comments 0
You need to be logged in to leave comments. Login now