Changeset View
Changeset View
Standalone View
Standalone View
mercurial/localrepo.py
Show First 20 Lines • Show All 3359 Lines • ▼ Show 20 Line(s) | def savecommitmessage(self, text): | ||||
fp = self.vfs(b'last-message.txt', b'wb') | fp = self.vfs(b'last-message.txt', b'wb') | ||||
try: | try: | ||||
fp.write(text) | fp.write(text) | ||||
finally: | finally: | ||||
fp.close() | fp.close() | ||||
return self.pathto(fp.name[len(self.root) + 1 :]) | return self.pathto(fp.name[len(self.root) + 1 :]) | ||||
def register_wanted_sidedata(self, category): | def register_wanted_sidedata(self, category): | ||||
if requirementsmod.REVLOGV2_REQUIREMENT not in self.requirements: | |||||
# Only revlogv2 repos can want sidedata. | |||||
return | |||||
self._wanted_sidedata.add(pycompat.bytestr(category)) | self._wanted_sidedata.add(pycompat.bytestr(category)) | ||||
def register_sidedata_computer(self, kind, category, keys, computer): | def register_sidedata_computer(self, kind, category, keys, computer): | ||||
if kind not in revlogconst.ALL_KINDS: | if kind not in revlogconst.ALL_KINDS: | ||||
msg = _(b"unexpected revlog kind %r.") | msg = _(b"unexpected revlog kind %r.") | ||||
raise error.ProgrammingError(msg % kind) | raise error.ProgrammingError(msg % kind) | ||||
category = pycompat.bytestr(category) | category = pycompat.bytestr(category) | ||||
if category in self._sidedata_computers.get(kind, []): | if category in self._sidedata_computers.get(kind, []): | ||||
▲ Show 20 Lines • Show All 385 Lines • Show Last 20 Lines |