Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/replay.py
Show First 20 Lines • Show All 298 Lines • ▼ Show 20 Lines | def close(self) -> None: | ||||
elif not os.path.isdir(self.fullpath): # not a real link ... | elif not os.path.isdir(self.fullpath): # not a real link ... | ||||
# when a file with the svn:special property set is not a svn link, | # when a file with the svn:special property set is not a svn link, | ||||
# the svn export operation might extract a truncated version of it | # the svn export operation might extract a truncated version of it | ||||
# if it is a binary file, so ensure to produce the same file as the | # if it is a binary file, so ensure to produce the same file as the | ||||
# export operation. | # export operation. | ||||
with open(self.fullpath, "rb") as f: | with open(self.fullpath, "rb") as f: | ||||
content = f.read() | content = f.read() | ||||
self.svnrepo.export( | self.svnrepo.export( | ||||
os.path.join(self.svnrepo.remote_url.encode(), self.path), | os.path.join(self.svnrepo.remote_url, os.fsdecode(self.path)), | ||||
to=self.fullpath, | to=self.fullpath, | ||||
peg_rev=self.editor.revnum, | peg_rev=self.editor.revnum, | ||||
ignore_keywords=True, | ignore_keywords=True, | ||||
overwrite=True, | overwrite=True, | ||||
) | ) | ||||
with open(self.fullpath, "rb") as f: | with open(self.fullpath, "rb") as f: | ||||
exported_data = f.read() | exported_data = f.read() | ||||
if exported_data != content: | if exported_data != content: | ||||
▲ Show 20 Lines • Show All 741 Lines • Show Last 20 Lines |