comparison mercurial/filelog.py @ 43077:687b865b95ad

formatting: byteify all mercurial/ and hgext/ string literals Done with python3.7 contrib/byteify-strings.py -i $(hg files 'set:mercurial/**.py - mercurial/thirdparty/** + hgext/**.py - hgext/fsmonitor/pywatchman/** - mercurial/__init__.py') black -l 80 -t py33 -S $(hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" - hgext/fsmonitor/pywatchman/**') # skip-blame mass-reformatting only Differential Revision: https://phab.mercurial-scm.org/D6972
author Augie Fackler <augie@google.com>
date Sun, 06 Oct 2019 09:48:39 -0400
parents 2372284d9457
children a5206e71c536
comparison
equal deleted inserted replaced
43076:2372284d9457 43077:687b865b95ad
25 25
26 @interfaceutil.implementer(repository.ifilestorage) 26 @interfaceutil.implementer(repository.ifilestorage)
27 class filelog(object): 27 class filelog(object):
28 def __init__(self, opener, path): 28 def __init__(self, opener, path):
29 self._revlog = revlog.revlog( 29 self._revlog = revlog.revlog(
30 opener, '/'.join(('data', path + '.i')), censorable=True 30 opener, b'/'.join((b'data', path + b'.i')), censorable=True
31 ) 31 )
32 # Full name of the user visible file, relative to the repository root. 32 # Full name of the user visible file, relative to the repository root.
33 # Used by LFS. 33 # Used by LFS.
34 self._revlog.filename = path 34 self._revlog.filename = path
35 35
142 maybemissingparents=False, 142 maybemissingparents=False,
143 ): 143 ):
144 if maybemissingparents: 144 if maybemissingparents:
145 raise error.Abort( 145 raise error.Abort(
146 _( 146 _(
147 'revlog storage does not support missing ' 147 b'revlog storage does not support missing '
148 'parents write mode' 148 b'parents write mode'
149 ) 149 )
150 ) 150 )
151 151
152 return self._revlog.addgroup( 152 return self._revlog.addgroup(
153 deltas, linkmapper, transaction, addrevisioncb=addrevisioncb 153 deltas, linkmapper, transaction, addrevisioncb=addrevisioncb
167 167
168 def read(self, node): 168 def read(self, node):
169 return storageutil.filtermetadata(self.revision(node)) 169 return storageutil.filtermetadata(self.revision(node))
170 170
171 def add(self, text, meta, transaction, link, p1=None, p2=None): 171 def add(self, text, meta, transaction, link, p1=None, p2=None):
172 if meta or text.startswith('\1\n'): 172 if meta or text.startswith(b'\1\n'):
173 text = storageutil.packmeta(meta, text) 173 text = storageutil.packmeta(meta, text)
174 return self.addrevision(text, transaction, link, p1, p2) 174 return self.addrevision(text, transaction, link, p1, p2)
175 175
176 def renamed(self, node): 176 def renamed(self, node):
177 return storageutil.filerevisioncopied(self, node) 177 return storageutil.filerevisioncopied(self, node)
228 self._revlog.indexfile = value 228 self._revlog.indexfile = value
229 229
230 # Used by repo upgrade. 230 # Used by repo upgrade.
231 def clone(self, tr, destrevlog, **kwargs): 231 def clone(self, tr, destrevlog, **kwargs):
232 if not isinstance(destrevlog, filelog): 232 if not isinstance(destrevlog, filelog):
233 raise error.ProgrammingError('expected filelog to clone()') 233 raise error.ProgrammingError(b'expected filelog to clone()')
234 234
235 return self._revlog.clone(tr, destrevlog._revlog, **kwargs) 235 return self._revlog.clone(tr, destrevlog._revlog, **kwargs)
236 236
237 237
238 class narrowfilelog(filelog): 238 class narrowfilelog(filelog):