Changeset - 0b1a23b88f9a
[Not reviewed]
default
0 4 0
Thomas De Schampheleire - 5 years ago 2020-11-07 20:59:03
thomas.de_schampheleire@nokia.com
cleanup: get rid of redundant assignments 'foo = foo'

Redundant assignments were searched with:

grep '^ *\(.*\) = \1$' `hg files`

Some of these cases have resulted from earlier cleanup, like:

foo = safe_unicode(foo)

and later batch removing safe_unicode usage. See e.g. commit
e35373106528b29461b7f5144780cb9ec79f765d .


Note: two false positives occur:

kallithea/tests/models/test_settings.py:39:
setting.app_settings_value = setting.app_settings_value
kallithea/tests/models/test_settings.py:42:
setting.app_settings_value = setting.app_settings_value

which is not a plain assignment but where 'app_settings_value' is a property
method with side effects.
4 files changed with 0 insertions and 7 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/api/api.py
Show inline comments
 
@@ -1143,7 +1143,6 @@ class ApiController(JSONRPCController):
 
            if not HasRepoPermissionLevel('read')(repo.repo_name):
 
                raise JSONRPCError('repository `%s` does not exist' % (repoid,))
 

	
 
        ret_type = ret_type
 
        _map = {}
 
        try:
 
            _d, _f = ScmModel().get_nodes(repo, revision, root_path,
kallithea/model/repo.py
Show inline comments
 
@@ -321,8 +321,6 @@ class RepoModel(object):
 
        fork_of = db.Repository.guess_instance(fork_of)
 
        repo_group = db.RepoGroup.guess_instance(repo_group)
 
        try:
 
            repo_name = repo_name
 
            description = description
 
            # repo name is just a name of repository
 
            # while repo_name_full is a full qualified name that is combined
 
            # with name and path of group
kallithea/model/scm.py
Show inline comments
 
@@ -451,7 +451,6 @@ class ScmModel(object):
 
                content = content.read()
 
            processed_nodes.append((f_path, content))
 

	
 
        message = message
 
        committer = user.full_contact
 
        if not author:
 
            author = committer
 
@@ -493,7 +492,6 @@ class ScmModel(object):
 
        user = db.User.guess_instance(user)
 
        scm_instance = repo.scm_instance_no_cache()
 

	
 
        message = message
 
        committer = user.full_contact
 
        if not author:
 
            author = committer
 
@@ -572,7 +570,6 @@ class ScmModel(object):
 
            content = nodes[f_path].get('content')
 
            processed_nodes.append((f_path, content))
 

	
 
        message = message
 
        committer = user.full_contact
 
        if not author:
 
            author = committer
kallithea/tests/scripts/manual_test_crawler.py
Show inline comments
 
@@ -83,7 +83,6 @@ urllib.request.install_opener(o)
 
def _get_repo(proj):
 
    if isinstance(proj, str):
 
        repo = vcs.get_repo(os.path.join(PROJECT_PATH, proj))
 
        proj = proj
 
    else:
 
        repo = proj
 
        proj = repo.name
0 comments (0 inline, 0 general)