changeset 7812:fe4086096758

flake8: fix some F401 '...' imported but unused
author Mads Kiilerich <mads@kiilerich.com>
date Wed, 07 Aug 2019 23:48:26 +0200
parents 0a277465fddf
children f79b864dc192
files conftest.py kallithea/bin/kallithea_cli_ishell.py kallithea/config/app_cfg.py kallithea/controllers/admin/gists.py kallithea/controllers/admin/my_account.py kallithea/controllers/admin/repo_groups.py kallithea/controllers/admin/repos.py kallithea/controllers/admin/settings.py kallithea/controllers/admin/user_groups.py kallithea/controllers/api/__init__.py kallithea/controllers/api/api.py kallithea/controllers/changeset.py kallithea/controllers/error.py kallithea/controllers/home.py kallithea/controllers/journal.py kallithea/controllers/pullrequests.py kallithea/controllers/summary.py kallithea/lib/auth.py kallithea/lib/auth_modules/auth_container.py kallithea/lib/auth_modules/auth_crowd.py kallithea/lib/auth_modules/auth_ldap.py kallithea/lib/celerylib/__init__.py kallithea/lib/celerypylons/__init__.py kallithea/lib/db_manage.py kallithea/lib/exceptions.py kallithea/lib/hooks.py kallithea/lib/indexers/daemon.py kallithea/lib/middleware/simplegit.py kallithea/lib/utils.py kallithea/lib/utils2.py kallithea/lib/vcs/__init__.py kallithea/lib/vcs/backends/hg/changeset.py kallithea/lib/vcs/backends/hg/inmemory.py kallithea/lib/vcs/backends/hg/repository.py kallithea/lib/vcs/utils/helpers.py kallithea/model/db.py kallithea/model/notification.py kallithea/model/pull_request.py kallithea/model/repo.py kallithea/model/scm.py kallithea/model/user.py kallithea/tests/api/api_base.py kallithea/tests/base.py kallithea/tests/conftest.py kallithea/tests/fixture.py kallithea/tests/functional/test_admin_permissions.py kallithea/tests/functional/test_admin_repo_groups.py kallithea/tests/functional/test_admin_repos.py kallithea/tests/functional/test_admin_users.py kallithea/tests/functional/test_files.py kallithea/tests/functional/test_forks.py kallithea/tests/functional/test_home.py kallithea/tests/functional/test_login.py kallithea/tests/functional/test_pullrequests.py kallithea/tests/functional/test_search.py kallithea/tests/models/common.py kallithea/tests/models/test_notifications.py kallithea/tests/other/test_auth_ldap.py kallithea/tests/other/test_vcs_operations.py kallithea/tests/vcs/base.py kallithea/tests/vcs/test_changesets.py kallithea/tests/vcs/test_inmemchangesets.py
diffstat 62 files changed, 27 insertions(+), 117 deletions(-) [+]
line wrap: on
line diff
--- a/conftest.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/conftest.py	Wed Aug 07 23:48:26 2019 +0200
@@ -1,5 +1,4 @@
 import os
-import sys
 
 import mock
 import pytest
--- a/kallithea/bin/kallithea_cli_ishell.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/bin/kallithea_cli_ishell.py	Wed Aug 07 23:48:26 2019 +0200
@@ -21,8 +21,6 @@
 """
 import sys
 
-import click
-
 import kallithea.bin.kallithea_cli_base as cli_base
 from kallithea.model.db import *
 
--- a/kallithea/config/app_cfg.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/config/app_cfg.py	Wed Aug 07 23:48:26 2019 +0200
@@ -23,7 +23,6 @@
 import sys
 
 import alembic.config
-import formencode
 import mercurial
 import tg
 from alembic.migration import MigrationContext
@@ -40,9 +39,8 @@
 from kallithea.lib.middleware.permanent_repo_url import PermanentRepoUrl
 from kallithea.lib.middleware.simplegit import SimpleGit
 from kallithea.lib.middleware.simplehg import SimpleHg
-from kallithea.lib.utils import check_git_version, load_rcextensions, make_ui, repo2db_mapper, set_app_settings, set_indexer_config, set_vcs_config
+from kallithea.lib.utils import check_git_version, load_rcextensions, make_ui, set_app_settings, set_indexer_config, set_vcs_config
 from kallithea.lib.utils2 import str2bool
-from kallithea.model.scm import ScmModel
 
 
 log = logging.getLogger(__name__)
--- a/kallithea/controllers/admin/gists.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/controllers/admin/gists.py	Wed Aug 07 23:48:26 2019 +0200
@@ -26,7 +26,6 @@
 """
 
 import logging
-import time
 import traceback
 
 import formencode.htmlfill
@@ -43,7 +42,7 @@
 from kallithea.lib.page import Page
 from kallithea.lib.utils2 import safe_int, safe_unicode, time_to_datetime
 from kallithea.lib.vcs.exceptions import NodeNotChangedError, VCSError
-from kallithea.model.db import Gist, User
+from kallithea.model.db import Gist
 from kallithea.model.forms import GistForm
 from kallithea.model.gist import GistModel
 from kallithea.model.meta import Session
--- a/kallithea/controllers/admin/my_account.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/controllers/admin/my_account.py	Wed Aug 07 23:48:26 2019 +0200
@@ -30,7 +30,6 @@
 
 import formencode
 from formencode import htmlfill
-from sqlalchemy import func
 from tg import request
 from tg import tmpl_context as c
 from tg.i18n import ugettext as _
--- a/kallithea/controllers/admin/repo_groups.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/controllers/admin/repo_groups.py	Wed Aug 07 23:48:26 2019 +0200
@@ -31,7 +31,6 @@
 
 import formencode
 from formencode import htmlfill
-from sqlalchemy.sql.expression import func
 from tg import app_globals, request
 from tg import tmpl_context as c
 from tg.i18n import ugettext as _
--- a/kallithea/controllers/admin/repos.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/controllers/admin/repos.py	Wed Aug 07 23:48:26 2019 +0200
@@ -30,7 +30,6 @@
 
 import formencode
 from formencode import htmlfill
-from sqlalchemy.sql.expression import func
 from tg import request
 from tg import tmpl_context as c
 from tg.i18n import ugettext as _
--- a/kallithea/controllers/admin/settings.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/controllers/admin/settings.py	Wed Aug 07 23:48:26 2019 +0200
@@ -42,7 +42,7 @@
 from kallithea.lib.celerylib import tasks
 from kallithea.lib.exceptions import HgsubversionImportError
 from kallithea.lib.utils import repo2db_mapper, set_app_settings
-from kallithea.lib.utils2 import safe_unicode, str2bool
+from kallithea.lib.utils2 import safe_unicode
 from kallithea.lib.vcs import VCSError
 from kallithea.model.db import Repository, Setting, Ui
 from kallithea.model.forms import ApplicationSettingsForm, ApplicationUiSettingsForm, ApplicationVisualisationForm
--- a/kallithea/controllers/admin/user_groups.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/controllers/admin/user_groups.py	Wed Aug 07 23:48:26 2019 +0200
@@ -48,7 +48,6 @@
 from kallithea.model.db import User, UserGroup, UserGroupRepoGroupToPerm, UserGroupRepoToPerm, UserGroupToPerm
 from kallithea.model.forms import CustomDefaultPermissionsForm, UserGroupForm, UserGroupPermsForm
 from kallithea.model.meta import Session
-from kallithea.model.repo import RepoModel
 from kallithea.model.scm import UserGroupList
 from kallithea.model.user_group import UserGroupModel
 
--- a/kallithea/controllers/api/__init__.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/controllers/api/__init__.py	Wed Aug 07 23:48:26 2019 +0200
@@ -33,14 +33,13 @@
 import types
 
 from tg import Response, TGController, request, response
-from webob.exc import HTTPError, HTTPException, WSGIHTTPException
+from webob.exc import HTTPError, HTTPException
 
 from kallithea.lib.auth import AuthUser
 from kallithea.lib.base import _get_access_path
 from kallithea.lib.base import _get_ip_addr as _get_ip
 from kallithea.lib.compat import json
 from kallithea.lib.utils2 import safe_str, safe_unicode
-from kallithea.model import meta
 from kallithea.model.db import User
 
 
--- a/kallithea/controllers/api/api.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/controllers/api/api.py	Wed Aug 07 23:48:26 2019 +0200
@@ -26,22 +26,19 @@
 """
 
 import logging
-import time
 import traceback
 from datetime import datetime
 
-from sqlalchemy import or_
 from tg import request
 
 from kallithea.controllers.api import JSONRPCController, JSONRPCError
 from kallithea.lib.auth import (
-    AuthUser, HasPermissionAny, HasPermissionAnyDecorator, HasRepoGroupPermissionLevel, HasRepoPermissionLevel, HasUserGroupPermissionLevel, PasswordGenerator)
-from kallithea.lib.compat import json
+    AuthUser, HasPermissionAny, HasPermissionAnyDecorator, HasRepoGroupPermissionLevel, HasRepoPermissionLevel, HasUserGroupPermissionLevel)
 from kallithea.lib.exceptions import DefaultUserException, UserGroupsAssignedException
-from kallithea.lib.utils import action_logger, map_groups, repo2db_mapper
-from kallithea.lib.utils2 import OAttr, Optional, safe_int, str2bool, time_to_datetime
+from kallithea.lib.utils import action_logger, repo2db_mapper
+from kallithea.lib.utils2 import OAttr, Optional
 from kallithea.lib.vcs.backends.base import EmptyChangeset
-from kallithea.lib.vcs.exceptions import ChangesetDoesNotExistError, EmptyRepositoryError
+from kallithea.lib.vcs.exceptions import EmptyRepositoryError
 from kallithea.model.changeset_status import ChangesetStatusModel
 from kallithea.model.comment import ChangesetCommentsModel
 from kallithea.model.db import ChangesetStatus, Gist, Permission, PullRequest, RepoGroup, Repository, Setting, User, UserGroup, UserIpMap
--- a/kallithea/controllers/changeset.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/controllers/changeset.py	Wed Aug 07 23:48:26 2019 +0200
@@ -48,7 +48,6 @@
 from kallithea.model.db import ChangesetComment, ChangesetStatus
 from kallithea.model.meta import Session
 from kallithea.model.pull_request import PullRequestModel
-from kallithea.model.repo import RepoModel
 
 
 log = logging.getLogger(__name__)
--- a/kallithea/controllers/error.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/controllers/error.py	Wed Aug 07 23:48:26 2019 +0200
@@ -27,13 +27,12 @@
 
 import cgi
 import logging
-import os
 
 from tg import config, expose, request
 from tg import tmpl_context as c
 from tg.i18n import ugettext as _
 
-from kallithea.lib.base import BaseController, render
+from kallithea.lib.base import BaseController
 
 
 log = logging.getLogger(__name__)
--- a/kallithea/controllers/home.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/controllers/home.py	Wed Aug 07 23:48:26 2019 +0200
@@ -28,8 +28,7 @@
 
 import logging
 
-from sqlalchemy import and_, or_
-from sqlalchemy.sql.expression import func
+from sqlalchemy import or_
 from tg import request
 from tg import tmpl_context as c
 from tg.i18n import ugettext as _
--- a/kallithea/controllers/journal.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/controllers/journal.py	Wed Aug 07 23:48:26 2019 +0200
@@ -32,7 +32,6 @@
 
 from sqlalchemy import or_
 from sqlalchemy.orm import joinedload
-from sqlalchemy.sql.expression import func
 from tg import request, response
 from tg import tmpl_context as c
 from tg.i18n import ugettext as _
--- a/kallithea/controllers/pullrequests.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/controllers/pullrequests.py	Wed Aug 07 23:48:26 2019 +0200
@@ -36,14 +36,12 @@
 
 from kallithea.config.routing import url
 from kallithea.controllers.changeset import _context_url, _ignorews_url, create_cs_pr_comment, delete_cs_pr_comment
-from kallithea.controllers.compare import CompareController
 from kallithea.lib import diffs
 from kallithea.lib import helpers as h
 from kallithea.lib.auth import HasRepoPermissionLevelDecorator, LoginRequired
 from kallithea.lib.base import BaseRepoController, jsonify, render
 from kallithea.lib.graphmod import graph_data
 from kallithea.lib.page import Page
-from kallithea.lib.utils import action_logger
 from kallithea.lib.utils2 import safe_int
 from kallithea.lib.vcs.exceptions import ChangesetDoesNotExistError, EmptyRepositoryError
 from kallithea.lib.vcs.utils import safe_str
@@ -54,7 +52,6 @@
 from kallithea.model.forms import PullRequestForm, PullRequestPostForm
 from kallithea.model.meta import Session
 from kallithea.model.pull_request import CreatePullRequestAction, CreatePullRequestIterationAction, PullRequestModel
-from kallithea.model.repo import RepoModel
 
 
 log = logging.getLogger(__name__)
--- a/kallithea/controllers/summary.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/controllers/summary.py	Wed Aug 07 23:48:26 2019 +0200
@@ -45,11 +45,11 @@
 from kallithea.lib.compat import json
 from kallithea.lib.markup_renderer import MarkupRenderer
 from kallithea.lib.page import RepoPage
-from kallithea.lib.utils2 import safe_int, safe_str
+from kallithea.lib.utils2 import safe_int
 from kallithea.lib.vcs.backends.base import EmptyChangeset
 from kallithea.lib.vcs.exceptions import ChangesetError, EmptyRepositoryError, NodeDoesNotExistError
 from kallithea.lib.vcs.nodes import FileNode
-from kallithea.model.db import CacheInvalidation, Statistics, User
+from kallithea.model.db import CacheInvalidation, Statistics
 
 
 log = logging.getLogger(__name__)
--- a/kallithea/lib/auth.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/auth.py	Wed Aug 07 23:48:26 2019 +0200
@@ -24,26 +24,24 @@
 :copyright: (c) 2013 RhodeCode GmbH, and others.
 :license: GPLv3, see LICENSE.md for more details.
 """
-import collections
 import hashlib
 import itertools
 import logging
 import os
-import traceback
 
 import ipaddr
 from decorator import decorator
 from sqlalchemy.orm import joinedload
 from sqlalchemy.orm.exc import ObjectDeletedError
-from tg import request, session
+from tg import request
 from tg.i18n import ugettext as _
-from webob.exc import HTTPBadRequest, HTTPForbidden, HTTPFound, HTTPMethodNotAllowed
+from webob.exc import HTTPForbidden, HTTPFound
 
 from kallithea import __platform__, is_unix, is_windows
 from kallithea.config.routing import url
 from kallithea.lib.caching_query import FromCache
 from kallithea.lib.utils import conditional_cache, get_repo_group_slug, get_repo_slug, get_user_group_slug
-from kallithea.lib.utils2 import aslist, safe_str, safe_unicode
+from kallithea.lib.utils2 import safe_str, safe_unicode
 from kallithea.lib.vcs.utils.lazy import LazyProperty
 from kallithea.model.db import (
     Permission, RepoGroup, Repository, User, UserApiKeys, UserGroup, UserGroupMember, UserGroupRepoGroupToPerm, UserGroupRepoToPerm, UserGroupToPerm, UserGroupUserGroupToPerm, UserIpMap, UserToPerm)
--- a/kallithea/lib/auth_modules/auth_container.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/auth_modules/auth_container.py	Wed Aug 07 23:48:26 2019 +0200
@@ -30,7 +30,7 @@
 from kallithea.lib import auth_modules
 from kallithea.lib.compat import hybrid_property
 from kallithea.lib.utils2 import safe_str, safe_unicode, str2bool
-from kallithea.model.db import Setting, User
+from kallithea.model.db import Setting
 
 
 log = logging.getLogger(__name__)
--- a/kallithea/lib/auth_modules/auth_crowd.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/auth_modules/auth_crowd.py	Wed Aug 07 23:48:26 2019 +0200
@@ -32,7 +32,6 @@
 
 from kallithea.lib import auth_modules
 from kallithea.lib.compat import formatted_json, hybrid_property, json
-from kallithea.model.db import User
 
 
 log = logging.getLogger(__name__)
--- a/kallithea/lib/auth_modules/auth_ldap.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/auth_modules/auth_ldap.py	Wed Aug 07 23:48:26 2019 +0200
@@ -27,13 +27,11 @@
 
 
 import logging
-import traceback
 
 from kallithea.lib import auth_modules
 from kallithea.lib.compat import hybrid_property
 from kallithea.lib.exceptions import LdapConnectionError, LdapImportError, LdapPasswordError, LdapUsernameError
 from kallithea.lib.utils2 import safe_str, safe_unicode
-from kallithea.model.db import User
 
 
 log = logging.getLogger(__name__)
--- a/kallithea/lib/celerylib/__init__.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/celerylib/__init__.py	Wed Aug 07 23:48:26 2019 +0200
@@ -37,7 +37,6 @@
 from kallithea.lib.pidlock import DaemonLock, LockHeld
 from kallithea.lib.utils2 import safe_str
 from kallithea.model import meta
-from kallithea.model.base import init_model
 
 
 log = logging.getLogger(__name__)
--- a/kallithea/lib/celerypylons/__init__.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/celerypylons/__init__.py	Wed Aug 07 23:48:26 2019 +0200
@@ -14,9 +14,6 @@
 mandatory settings.
 """
 
-import os
-import warnings
-
 import celery
 import celery.result as result
 import tg
--- a/kallithea/lib/db_manage.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/db_manage.py	Wed Aug 07 23:48:26 2019 +0200
@@ -29,9 +29,7 @@
 import logging
 import os
 import sys
-import time
 import uuid
-from os.path import dirname
 
 import alembic.command
 import alembic.config
@@ -39,11 +37,10 @@
 from sqlalchemy.engine import create_engine
 
 from kallithea.model.base import init_model
-from kallithea.model.db import CacheInvalidation, Permission, RepoGroup, Repository, Setting, Ui, User, UserRepoGroupToPerm, UserToPerm
+from kallithea.model.db import Permission, RepoGroup, Repository, Setting, Ui, User, UserRepoGroupToPerm, UserToPerm
 #from kallithea.model import meta
 from kallithea.model.meta import Base, Session
 from kallithea.model.permission import PermissionModel
-from kallithea.model.repo import RepoModel
 from kallithea.model.repo_group import RepoGroupModel
 from kallithea.model.user import UserModel
 
--- a/kallithea/lib/exceptions.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/exceptions.py	Wed Aug 07 23:48:26 2019 +0200
@@ -25,11 +25,6 @@
 :license: GPLv3, see LICENSE.md for more details.
 """
 
-from webob.exc import HTTPClientError
-
-from kallithea.lib.utils2 import safe_str
-
-
 class LdapUsernameError(Exception):
     pass
 
--- a/kallithea/lib/hooks.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/hooks.py	Wed Aug 07 23:48:26 2019 +0200
@@ -34,8 +34,8 @@
 from kallithea.lib.utils import action_logger, make_ui, setup_cache_regions
 from kallithea.lib.utils2 import get_hook_environment, safe_str, safe_unicode
 from kallithea.lib.vcs.backends.base import EmptyChangeset
-from kallithea.lib.vcs.utils.hgcompat import nullrev, revrange
-from kallithea.model.db import Repository, Ui, User
+from kallithea.lib.vcs.utils.hgcompat import revrange
+from kallithea.model.db import Repository, User
 
 
 def _get_scm_size(alias, root_path):
--- a/kallithea/lib/indexers/daemon.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/indexers/daemon.py	Wed Aug 07 23:48:26 2019 +0200
@@ -36,7 +36,6 @@
 
 from whoosh.index import create_in, exists_in, open_dir
 from whoosh.qparser import QueryParser
-from whoosh.query import *
 
 from kallithea.config.conf import INDEX_EXTENSIONS, INDEX_FILENAMES
 from kallithea.lib.indexers import CHGSET_IDX_NAME, CHGSETS_SCHEMA, IDX_NAME, SCHEMA
--- a/kallithea/lib/middleware/simplegit.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/middleware/simplegit.py	Wed Aug 07 23:48:26 2019 +0200
@@ -36,7 +36,7 @@
 from kallithea.lib.middleware.pygrack import make_wsgi_app
 from kallithea.lib.utils import make_ui
 from kallithea.lib.utils2 import safe_unicode
-from kallithea.model.db import Repository, Ui
+from kallithea.model.db import Repository
 
 
 log = logging.getLogger(__name__)
--- a/kallithea/lib/utils.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/utils.py	Wed Aug 07 23:48:26 2019 +0200
@@ -33,7 +33,6 @@
 
 import beaker
 from beaker.cache import _cache_decorate
-from tg import request, response
 from tg.i18n import ugettext as _
 
 from kallithea.lib.exceptions import HgsubversionImportError
--- a/kallithea/lib/utils2.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/utils2.py	Wed Aug 07 23:48:26 2019 +0200
@@ -33,13 +33,10 @@
 import os
 import pwd
 import re
-import sys
 import time
 import urllib
-import uuid
 
 import urlobject
-import webob
 from tg.i18n import ugettext as _
 from tg.i18n import ungettext
 from webhelpers2.text import collapse, remove_formatting, strip_tags
--- a/kallithea/lib/vcs/__init__.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/vcs/__init__.py	Wed Aug 07 23:48:26 2019 +0200
@@ -19,8 +19,6 @@
     'VCSError', 'RepositoryError', 'ChangesetError'
 ]
 
-import sys
-
 from kallithea.lib.vcs.backends import get_backend, get_repo
 from kallithea.lib.vcs.exceptions import ChangesetError, RepositoryError, VCSError
 
--- a/kallithea/lib/vcs/backends/hg/changeset.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/vcs/backends/hg/changeset.py	Wed Aug 07 23:48:26 2019 +0200
@@ -1,8 +1,6 @@
 import os
 import posixpath
 
-from mercurial import obsolete
-
 from kallithea.lib.vcs.backends.base import BaseChangeset
 from kallithea.lib.vcs.conf import settings
 from kallithea.lib.vcs.exceptions import ChangesetDoesNotExistError, ChangesetError, ImproperArchiveTypeError, NodeDoesNotExistError, VCSError
--- a/kallithea/lib/vcs/backends/hg/inmemory.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/vcs/backends/hg/inmemory.py	Wed Aug 07 23:48:26 2019 +0200
@@ -1,5 +1,4 @@
 import datetime
-import errno
 
 from kallithea.lib.vcs.backends.base import BaseInMemoryChangeset
 from kallithea.lib.vcs.exceptions import RepositoryError
--- a/kallithea/lib/vcs/backends/hg/repository.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/vcs/backends/hg/repository.py	Wed Aug 07 23:48:26 2019 +0200
@@ -22,7 +22,7 @@
     BranchDoesNotExistError, ChangesetDoesNotExistError, EmptyRepositoryError, RepositoryError, TagAlreadyExistError, TagDoesNotExistError, VCSError)
 from kallithea.lib.vcs.utils import author_email, author_name, date_fromtimestamp, makedate, safe_str, safe_unicode
 from kallithea.lib.vcs.utils.hgcompat import (
-    Abort, RepoError, RepoLookupError, clone, diffopts, get_contact, hex, hg_url, httpbasicauthhandler, httpdigestauthhandler, httppeer, localrepo, match, match_exact, nullid, patch, peer, scmutil, sshpeer, tag, ui)
+    Abort, RepoError, RepoLookupError, clone, diffopts, get_contact, hex, hg_url, httpbasicauthhandler, httpdigestauthhandler, httppeer, localrepo, match_exact, nullid, patch, peer, scmutil, sshpeer, tag, ui)
 from kallithea.lib.vcs.utils.lazy import LazyProperty
 from kallithea.lib.vcs.utils.paths import abspath
 
--- a/kallithea/lib/vcs/utils/helpers.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/lib/vcs/utils/helpers.py	Wed Aug 07 23:48:26 2019 +0200
@@ -7,7 +7,6 @@
 import os
 import re
 import time
-from subprocess import PIPE, Popen
 
 from kallithea.lib.vcs.exceptions import RepositoryError, VCSError
 from kallithea.lib.vcs.utils.paths import abspath
--- a/kallithea/model/db.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/model/db.py	Wed Aug 07 23:48:26 2019 +0200
@@ -47,8 +47,7 @@
 from kallithea.lib.caching_query import FromCache
 from kallithea.lib.compat import json
 from kallithea.lib.exceptions import DefaultUserException
-from kallithea.lib.utils2 import (
-    Optional, aslist, get_changeset_safe, get_clone_url, remove_prefix, safe_int, safe_str, safe_unicode, str2bool, time_to_datetime, urlreadable)
+from kallithea.lib.utils2 import Optional, aslist, get_changeset_safe, get_clone_url, remove_prefix, safe_int, safe_str, safe_unicode, str2bool, urlreadable
 from kallithea.lib.vcs import get_backend
 from kallithea.lib.vcs.backends.base import EmptyChangeset
 from kallithea.lib.vcs.utils.helpers import get_scm
--- a/kallithea/model/notification.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/model/notification.py	Wed Aug 07 23:48:26 2019 +0200
@@ -28,9 +28,7 @@
 
 import datetime
 import logging
-import traceback
 
-from sqlalchemy.orm import joinedload, subqueryload
 from tg import app_globals
 from tg import tmpl_context as c
 from tg.i18n import ugettext as _
@@ -39,7 +37,6 @@
 from kallithea.lib import helpers as h
 from kallithea.lib.utils2 import safe_unicode
 from kallithea.model.db import User
-from kallithea.model.meta import Session
 
 
 log = logging.getLogger(__name__)
--- a/kallithea/model/pull_request.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/model/pull_request.py	Wed Aug 07 23:48:26 2019 +0200
@@ -29,7 +29,6 @@
 import logging
 import re
 
-from sqlalchemy.orm import joinedload
 from tg import request
 from tg.i18n import ugettext as _
 
--- a/kallithea/model/repo.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/model/repo.py	Wed Aug 07 23:48:26 2019 +0200
@@ -32,8 +32,6 @@
 import traceback
 from datetime import datetime
 
-from sqlalchemy.orm import subqueryload
-
 import kallithea.lib.utils2
 from kallithea.lib import helpers as h
 from kallithea.lib.auth import HasRepoPermissionLevel, HasUserGroupPermissionLevel
@@ -45,7 +43,6 @@
 from kallithea.lib.vcs.backends import get_backend
 from kallithea.model.db import (
     Permission, RepoGroup, Repository, RepositoryField, Session, Statistics, Ui, User, UserGroup, UserGroupRepoGroupToPerm, UserGroupRepoToPerm, UserRepoGroupToPerm, UserRepoToPerm)
-from kallithea.model.scm import UserGroupList
 
 
 log = logging.getLogger(__name__)
--- a/kallithea/model/scm.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/model/scm.py	Wed Aug 07 23:48:26 2019 +0200
@@ -31,16 +31,13 @@
 import posixpath
 import re
 import sys
-import time
 import traceback
 
 import pkg_resources
-from sqlalchemy import func
 from tg.i18n import ugettext as _
 
 import kallithea
 from kallithea import BACKENDS
-from kallithea.lib import helpers as h
 from kallithea.lib.auth import HasPermissionAny, HasRepoGroupPermissionLevel, HasRepoPermissionLevel, HasUserGroupPermissionLevel
 from kallithea.lib.exceptions import IMCCommitError, NonRelativePathError
 from kallithea.lib.hooks import process_pushed_raw_ids
--- a/kallithea/model/user.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/model/user.py	Wed Aug 07 23:48:26 2019 +0200
@@ -368,8 +368,6 @@
                      timestamp=timestamp)
 
     def verify_reset_password_token(self, email, timestamp, token):
-        from kallithea.lib.celerylib import tasks
-        from kallithea.lib import auth
         import kallithea.lib.helpers as h
         user = User.get_by_email(email)
         if user is None:
--- a/kallithea/tests/api/api_base.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/api/api_base.py	Wed Aug 07 23:48:26 2019 +0200
@@ -25,7 +25,6 @@
 
 from kallithea.lib.auth import AuthUser
 from kallithea.lib.compat import json
-from kallithea.lib.utils2 import time_to_datetime
 from kallithea.model.changeset_status import ChangesetStatusModel
 from kallithea.model.db import ChangesetStatus, PullRequest, RepoGroup, Repository, Setting, Ui, User
 from kallithea.model.gist import GistModel
--- a/kallithea/tests/base.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/base.py	Wed Aug 07 23:48:26 2019 +0200
@@ -20,13 +20,10 @@
 import time
 
 import pytest
-from tg import config
 from webtest import TestApp
 
-from kallithea import model
 from kallithea.lib.utils2 import safe_str
 from kallithea.model.db import User
-from kallithea.model.meta import Session
 
 
 log = logging.getLogger(__name__)
--- a/kallithea/tests/conftest.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/conftest.py	Wed Aug 07 23:48:26 2019 +0200
@@ -1,6 +1,5 @@
 import logging
 import os
-import re
 import sys
 import time
 
--- a/kallithea/tests/fixture.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/fixture.py	Wed Aug 07 23:48:26 2019 +0200
@@ -409,7 +409,7 @@
     """
 
     from kallithea.lib.indexers.daemon import WhooshIndexingDaemon
-    from kallithea.lib.pidlock import DaemonLock, LockHeld
+    from kallithea.lib.pidlock import DaemonLock
 
     index_location = os.path.join(config['index_dir'])
     if not os.path.exists(index_location):
--- a/kallithea/tests/functional/test_admin_permissions.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/functional/test_admin_permissions.py	Wed Aug 07 23:48:26 2019 +0200
@@ -1,10 +1,4 @@
-import time
-
-from tg.util.webtest import test_context
-
 from kallithea.model.db import User, UserIpMap
-from kallithea.model.meta import Session
-from kallithea.model.user import UserModel
 from kallithea.tests.base import *
 
 
--- a/kallithea/tests/functional/test_admin_repo_groups.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/functional/test_admin_repo_groups.py	Wed Aug 07 23:48:26 2019 +0200
@@ -1,4 +1,3 @@
-from kallithea.model.db import Repository
 from kallithea.model.meta import Session
 from kallithea.model.repo_group import RepoGroupModel
 from kallithea.tests.base import TestController, url
--- a/kallithea/tests/functional/test_admin_repos.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/functional/test_admin_repos.py	Wed Aug 07 23:48:26 2019 +0200
@@ -5,12 +5,11 @@
 
 import mock
 import pytest
-from sqlalchemy import func
 
 from kallithea.lib import vcs
 from kallithea.lib.utils2 import safe_str, safe_unicode
 from kallithea.model.db import Permission, RepoGroup, Repository, Ui, User, UserRepoToPerm
-from kallithea.model.meta import Base, Session
+from kallithea.model.meta import Session
 from kallithea.model.repo import RepoModel
 from kallithea.model.repo_group import RepoGroupModel
 from kallithea.model.user import UserModel
--- a/kallithea/tests/functional/test_admin_users.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/functional/test_admin_users.py	Wed Aug 07 23:48:26 2019 +0200
@@ -13,7 +13,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import pytest
-from sqlalchemy.orm.exc import NoResultFound, ObjectDeletedError
+from sqlalchemy.orm.exc import NoResultFound
 from tg.util.webtest import test_context
 from webob.exc import HTTPNotFound
 
@@ -21,7 +21,7 @@
 from kallithea.lib import helpers as h
 from kallithea.lib.auth import check_password
 from kallithea.model import validators
-from kallithea.model.db import Permission, RepoGroup, User, UserApiKeys, UserIpMap, UserSshKeys
+from kallithea.model.db import Permission, RepoGroup, User, UserApiKeys, UserSshKeys
 from kallithea.model.meta import Session
 from kallithea.model.user import UserModel
 from kallithea.tests.base import *
--- a/kallithea/tests/functional/test_files.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/functional/test_files.py	Wed Aug 07 23:48:26 2019 +0200
@@ -1,6 +1,5 @@
 # -*- coding: utf-8 -*-
 import mimetypes
-import os
 import posixpath
 
 from kallithea.model.db import Repository
--- a/kallithea/tests/functional/test_forks.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/functional/test_forks.py	Wed Aug 07 23:48:26 2019 +0200
@@ -1,6 +1,5 @@
 # -*- coding: utf-8 -*-
 
-import unittest
 import urllib
 
 from kallithea.lib.utils2 import safe_str, safe_unicode
--- a/kallithea/tests/functional/test_home.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/functional/test_home.py	Wed Aug 07 23:48:26 2019 +0200
@@ -1,7 +1,6 @@
 # -*- coding: utf-8 -*-
 import json
 
-from kallithea.model.db import Repository
 from kallithea.model.meta import Session
 from kallithea.model.repo import RepoModel
 from kallithea.model.repo_group import RepoGroupModel
--- a/kallithea/tests/functional/test_login.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/functional/test_login.py	Wed Aug 07 23:48:26 2019 +0200
@@ -3,7 +3,6 @@
 import time
 import urlparse
 
-import mock
 from tg.util.webtest import test_context
 
 from kallithea.lib import helpers as h
--- a/kallithea/tests/functional/test_pullrequests.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/functional/test_pullrequests.py	Wed Aug 07 23:48:26 2019 +0200
@@ -1,7 +1,6 @@
 import re
 
 import pytest
-from tg.util.webtest import test_context
 
 from kallithea.controllers.pullrequests import PullrequestsController
 from kallithea.model.db import PullRequest, User
--- a/kallithea/tests/functional/test_search.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/functional/test_search.py	Wed Aug 07 23:48:26 2019 +0200
@@ -1,5 +1,3 @@
-import os
-
 import mock
 
 from kallithea.tests.base import *
--- a/kallithea/tests/models/common.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/models/common.py	Wed Aug 07 23:48:26 2019 +0200
@@ -4,7 +4,6 @@
 from kallithea.model.repo import RepoModel
 from kallithea.model.repo_group import RepoGroupModel
 from kallithea.model.user import UserModel
-from kallithea.tests.base import *
 from kallithea.tests.fixture import Fixture
 
 
--- a/kallithea/tests/models/test_notifications.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/models/test_notifications.py	Wed Aug 07 23:48:26 2019 +0200
@@ -2,7 +2,6 @@
 import re
 
 import mock
-import routes.util
 from tg.util.webtest import test_context
 
 import kallithea.lib.celerylib
--- a/kallithea/tests/other/test_auth_ldap.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/other/test_auth_ldap.py	Wed Aug 07 23:48:26 2019 +0200
@@ -3,8 +3,7 @@
 import pytest
 
 from kallithea.lib.auth_modules import auth_ldap, authenticate
-from kallithea.model.db import Setting, User
-from kallithea.model.meta import Session
+from kallithea.model.db import User
 
 
 @pytest.fixture
--- a/kallithea/tests/other/test_vcs_operations.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/other/test_vcs_operations.py	Wed Aug 07 23:48:26 2019 +0200
@@ -39,7 +39,6 @@
 from kallithea import CONFIG
 from kallithea.model.db import CacheInvalidation, Repository, Ui, User, UserIpMap, UserLog
 from kallithea.model.meta import Session
-from kallithea.model.repo import RepoModel
 from kallithea.model.ssh_key import SshKeyModel
 from kallithea.model.user import UserModel
 from kallithea.tests.base import *
--- a/kallithea/tests/vcs/base.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/vcs/base.py	Wed Aug 07 23:48:26 2019 +0200
@@ -2,7 +2,6 @@
 Module providing backend independent mixin class.
 """
 import datetime
-import os
 import time
 
 import pytest
--- a/kallithea/tests/vcs/test_changesets.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/vcs/test_changesets.py	Wed Aug 07 23:48:26 2019 +0200
@@ -1,7 +1,6 @@
 # encoding: utf-8
 
 import datetime
-import time
 
 import pytest
 
@@ -10,7 +9,6 @@
 from kallithea.lib.vcs.exceptions import BranchDoesNotExistError, ChangesetDoesNotExistError, EmptyRepositoryError, RepositoryError
 from kallithea.lib.vcs.nodes import AddedFileNodesGenerator, ChangedFileNodesGenerator, FileNode, RemovedFileNodesGenerator
 from kallithea.tests.vcs.base import _BackendTestMixin
-from kallithea.tests.vcs.conf import get_new_dir
 
 
 class TestBaseChangeset(object):
--- a/kallithea/tests/vcs/test_inmemchangesets.py	Wed Aug 07 00:25:02 2019 +0200
+++ b/kallithea/tests/vcs/test_inmemchangesets.py	Wed Aug 07 23:48:26 2019 +0200
@@ -4,7 +4,6 @@
 """
 
 import datetime
-import time
 
 import pytest