Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/ra.py
# Copyright (C) 2016-2018 The Software Heritage developers | # Copyright (C) 2016-2020 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
"""Remote Access client to svn server. | """Remote Access client to svn server. | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | def close(self): | ||||
# or checkout operation with subversion | # or checkout operation with subversion | ||||
with open(self.fullpath, 'rb') as f: | with open(self.fullpath, 'rb') as f: | ||||
data = f.read() | data = f.read() | ||||
data = _normalize_line_endings(data, eol_style) | data = _normalize_line_endings(data, eol_style) | ||||
mode = os.lstat(self.fullpath).st_mode | mode = os.lstat(self.fullpath).st_mode | ||||
self.directory[self.path] = Content.from_bytes(mode=mode, | self.directory[self.path] = Content.from_bytes(mode=mode, | ||||
data=data) | data=data) | ||||
else: | else: | ||||
self.directory[self.path] = Content.from_file(path=self.fullpath, | self.directory[self.path] = Content.from_file(path=self.fullpath) | ||||
data=True) | |||||
class BaseDirEditor: | class BaseDirEditor: | ||||
"""Base class implementation of dir editor. | """Base class implementation of dir editor. | ||||
see :class:`DirEditor` for an implementation that hashes every | see :class:`DirEditor` for an implementation that hashes every | ||||
directory encountered. | directory encountered. | ||||
▲ Show 20 Lines • Show All 248 Lines • Show Last 20 Lines |