Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/ra.py
Show First 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | def close(self): | ||||
if not is_link: # if a link, do nothing regarding flag | if not is_link: # if a link, do nothing regarding flag | ||||
if self.executable == EXEC_FLAG: | if self.executable == EXEC_FLAG: | ||||
os.chmod(self.fullpath, 0o755) | os.chmod(self.fullpath, 0o755) | ||||
elif self.executable == NOEXEC_FLAG: | elif self.executable == NOEXEC_FLAG: | ||||
os.chmod(self.fullpath, 0o644) | os.chmod(self.fullpath, 0o644) | ||||
# And now compute file's checksums | # And now compute file's checksums | ||||
eol_style = EOL_STYLE.get(self.fullpath, None) | eol_style = EOL_STYLE.get(self.fullpath, None) | ||||
if eol_style: | if eol_style and not is_link: | ||||
# ensure to normalize line endings as defined by svn:eol-style | # ensure to normalize line endings as defined by svn:eol-style | ||||
# property to get the same file checksum as after an export | # property to get the same file checksum as after an export | ||||
# 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] = from_disk.Content.from_bytes( | self.directory[self.path] = from_disk.Content.from_bytes( | ||||
▲ Show 20 Lines • Show All 290 Lines • Show Last 20 Lines |