# HG changeset patch # User RhodeCode Admin # Date 2023-11-23 08:38:12 # Node ID 4a692945f83f41251217de913aa9646abeac46b6 # Parent 179916c22cde73dd810d7731d30fc4014e68c7a2 chore(code-cleanups): small fixes for readability diff --git a/rhodecode/lib/vcs/backends/base.py b/rhodecode/lib/vcs/backends/base.py --- a/rhodecode/lib/vcs/backends/base.py +++ b/rhodecode/lib/vcs/backends/base.py @@ -1599,8 +1599,7 @@ class BaseInMemoryCommit(object): pass if self.changed and missing: raise NodeDoesNotExistError( - "Node `%s` marked as modified but missing in parents: %s" - % (node.path, parents)) + f"Node `{node.path}` marked as modified but missing in parents: {parents}") if self.changed and not_changed: raise NodeNotChangedError( diff --git a/rhodecode/model/pull_request.py b/rhodecode/model/pull_request.py --- a/rhodecode/model/pull_request.py +++ b/rhodecode/model/pull_request.py @@ -1153,10 +1153,8 @@ class PullRequestModel(BaseModel): pull_request.common_ancestor_id = ancestor_commit_id - pull_request.source_ref = '%s:%s:%s' % ( - source_ref_type, source_ref_name, source_commit.raw_id) - pull_request.target_ref = '%s:%s:%s' % ( - target_ref_type, target_ref_name, ancestor_commit_id) + pull_request.source_ref = f'{source_ref_type}:{source_ref_name}:{source_commit.raw_id}' + pull_request.target_ref = f'{target_ref_type}:{target_ref_name}:{ancestor_commit_id}' pull_request.revisions = [ commit.raw_id for commit in reversed(commit_ranges)] diff --git a/rhodecode/tests/vcs/test_branches.py b/rhodecode/tests/vcs/test_branches.py --- a/rhodecode/tests/vcs/test_branches.py +++ b/rhodecode/tests/vcs/test_branches.py @@ -57,8 +57,8 @@ class TestBranches(BackendTestMixin): FileNode(b'docs/index.txt', content=b'Documentation\n') ) foobar_tip = self.imc.commit( - message=u'New branch: foobar', - author=u'joe ', + message='New branch: foobar', + author='joe ', branch='foobar', ) assert 'foobar' in self.repo.branches @@ -72,8 +72,8 @@ class TestBranches(BackendTestMixin): content=b'Documentation\n') ) foobar_tip = self.imc.commit( - message=u'New branch: foobar', - author=u'joe ', + message='New branch: foobar', + author='joe ', branch='foobar', parents=[tip], )