Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7343148
D7199.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
D7199.diff
View Options
diff --git a/swh/loader/cvs/loader.py b/swh/loader/cvs/loader.py
--- a/swh/loader/cvs/loader.py
+++ b/swh/loader/cvs/loader.py
@@ -161,8 +161,8 @@
path = file_path(self.cvsroot_path, f.path)
wtpath = os.path.join(self.tempdir_path, path)
if not self.file_path_is_safe(wtpath):
- raise BadPathException("unsafe path found in RCS file: %s" % f.path)
- self.log.info("rev %s state %s file %s" % (f.rev, f.state, f.path))
+ raise BadPathException(f"unsafe path found in RCS file: {f.path}")
+ self.log.info("rev %s state %s file %s", f.rev, f.state, f.path)
if f.state == "dead":
# remove this file from work tree
try:
@@ -210,8 +210,8 @@
path = file_path(self.cvsroot_path, f.path)
wtpath = os.path.join(self.tempdir_path, path)
if not self.file_path_is_safe(wtpath):
- raise BadPathException("unsafe path found in cvs rlog output: %s" % f.path)
- self.log.info("rev %s state %s file %s" % (f.rev, f.state, f.path))
+ raise BadPathException(f"unsafe path found in cvs rlog output: {f.path}")
+ self.log.info("rev %s state %s file %s", f.rev, f.state, f.path)
if f.state == "dead":
# remove this file from work tree
try:
@@ -221,7 +221,7 @@
else:
dirname = os.path.dirname(wtpath)
os.makedirs(dirname, exist_ok=True)
- self.log.debug("checkout to %s\n" % wtpath)
+ self.log.debug("checkout to %s\n", wtpath)
fp = cvsclient.checkout(path, f.rev, dirname, expand_keywords=True)
os.rename(fp.name, wtpath)
try:
@@ -351,11 +351,9 @@
if have_module and have_cvsroot:
break
if not have_module:
- raise NotFound(
- "CVS module %s not found at %s" % (self.cvs_module_name, url)
- )
+ raise NotFound(f"CVS module {self.cvs_module_name} not found at {url}")
if not have_cvsroot:
- raise NotFound("No CVSROOT directory found at %s" % url)
+ raise NotFound(f"No CVSROOT directory found at {url}")
# Fetch the CVSROOT directory and the desired CVS module.
assert self.cvsroot_path
@@ -384,7 +382,7 @@
url.path,
)
if not url.path:
- raise NotFound("Invalid CVS origin URL '%s'" % self.origin_url)
+ raise NotFound(f"Invalid CVS origin URL '{self.origin_url}'")
self.cvs_module_name = os.path.basename(url.path)
self.server_style_cvsroot = os.path.dirname(url.path)
self.worktree_path = os.path.join(self.tempdir_path, self.cvs_module_name)
@@ -425,8 +423,8 @@
if not have_rcsfile:
raise NotFound(
- "Directory %s does not contain any valid RCS files %s",
- self.cvsroot_path,
+ f"Directory {self.cvsroot_path} does not contain any valid "
+ "RCS files",
)
if not have_cvsroot:
self.log.warn(
@@ -535,7 +533,7 @@
cvs_changesets, use_rcsparse=False
)
else:
- raise NotFound("Invalid CVS origin URL '%s'" % self.origin_url)
+ raise NotFound(f"Invalid CVS origin URL '{self.origin_url}'")
def fetch_data(self) -> bool:
"""Fetch the next CVS revision."""
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 17 2025, 7:38 PM (7 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3227404
Attached To
D7199: Let the log instruction do the formatting
Event Timeline
Log In to Comment