Changeset - 1f94dd1e2757
[Not reviewed]
default
0 5 0
Na'Tosha Bard - 11 years ago 2014-09-19 10:54:51
natosha@unity3d.com
Fix readability issues in comments
5 files changed with 16 insertions and 18 deletions:
0 comments (0 inline, 0 general)
kallithea/model/changeset_status.py
Show inline comments
 
@@ -126,13 +126,13 @@ class ChangesetStatusModel(BaseModel):
 
        return status
 

	
 
    def set_status(self, repo, status, user, comment, revision=None,
 
                   pull_request=None, dont_allow_on_closed_pull_request=False):
 
        """
 
        Creates new status for changeset or updates the old ones bumping their
 
        version, leaving the current status at
 
        version, leaving the current status at the value of 'status'.
 

	
 
        :param repo:
 
        :param status:
 
        :param user:
 
        :param comment:
 
        :param revision:
kallithea/model/db.py
Show inline comments
 
@@ -1071,13 +1071,13 @@ class Repository(Base, BaseModel):
 
    def get_repo_forks(cls, repo_id):
 
        return cls.query().filter(Repository.fork_id == repo_id)
 

	
 
    @classmethod
 
    def base_path(cls):
 
        """
 
        Returns base path when all repos are stored
 
        Returns base path where all repos are stored
 

	
 
        :param cls:
 
        """
 
        q = Session().query(Ui)\
 
            .filter(Ui.ui_key == cls.url_sep())
 
        q = q.options(FromCache("sql_cache_short", "repository_repo_path"))
 
@@ -2463,13 +2463,13 @@ class Gist(Base, BaseModel):
 
        import kallithea.lib.helpers as h
 
        return h.canonical_url('gist', gist_id=self.gist_access_id)
 

	
 
    @classmethod
 
    def base_path(cls):
 
        """
 
        Returns base path when all gists are stored
 
        Returns base path where all gists are stored
 

	
 
        :param cls:
 
        """
 
        from kallithea.model.gist import GIST_STORE_LOC
 
        q = Session().query(Ui)\
 
            .filter(Ui.ui_key == URL_SEP)
kallithea/model/permission.py
Show inline comments
 
@@ -56,14 +56,15 @@ class PermissionModel(BaseModel):
 
                new_perm.permission_name = p[0]
 
                new_perm.permission_longname = p[0]  #translation err with p[1]
 
                self.sa.add(new_perm)
 

	
 
    def create_default_permissions(self, user, force=False):
 
        """
 
        Creates only missing default permissions for user, if force is set it
 
        resets the default permissions for that user
 
        Create missing default permissions for user. If force is set, the default
 
        permissions for the user are reset, otherwise only missing permissions are
 
        created.
 

	
 
        :param user:
 
        """
 
        user = self._get_user(user)
 

	
 
        def _make_perm(perm):
 
@@ -83,14 +84,14 @@ class PermissionModel(BaseModel):
 

	
 
        if force:
 
            for perm in perms:
 
                self.sa.delete(perm)
 
            self.sa.commit()
 
            defined_perms_groups = []
 
        # for every default permission that needs to be created, we check if
 
        # it's group is already defined, if it's not we create default perm
 
        # For every default permission that needs to be created, we check if
 
        # its group is already defined. If it's not, we create default permission.
 
        for perm_name in DEFAULT_PERMS:
 
            gr = _get_group(perm_name)
 
            if gr not in defined_perms_groups:
 
                log.debug('GR:%s not found, creating permission %s'
 
                          % (gr, perm_name))
 
                new_perm = _make_perm(perm_name)
kallithea/model/repo.py
Show inline comments
 
@@ -376,14 +376,14 @@ class RepoModel(BaseModel):
 
                     private=False, clone_uri=None, repo_group=None,
 
                     landing_rev='rev:tip', fork_of=None,
 
                     copy_fork_permissions=False, enable_statistics=False,
 
                     enable_locking=False, enable_downloads=False,
 
                     copy_group_permissions=False, state=Repository.STATE_PENDING):
 
        """
 
        Create repository inside database with PENDING state, this should be
 
        only executed by create() repo. With exception of importing existing repos
 
        Create repository inside database with PENDING state. This should only be
 
        executed by create() repo, with exception of importing existing repos.
 

	
 
        """
 
        from kallithea.model.scm import ScmModel
 

	
 
        owner = self._get_user(owner)
 
        fork_of = self._get_repo(fork_of)
 
@@ -678,15 +678,14 @@ class RepoModel(BaseModel):
 
            log.error(traceback.format_exc())
 
            raise
 

	
 
    def _create_filesystem_repo(self, repo_name, repo_type, repo_group,
 
                                clone_uri=None, repo_store_location=None):
 
        """
 
        makes repository on filesystem. It's group aware means it'll create
 
        a repository within a group, and alter the paths accordingly of
 
        group location
 
        Makes repository on filesystem. Operation is group aware, meaning that it will create
 
        a repository within a group, and alter the paths accordingly to the group location.
 

	
 
        :param repo_name:
 
        :param alias:
 
        :param parent:
 
        :param clone_uri:
 
        :param repo_store_location:
kallithea/model/scm.py
Show inline comments
 
@@ -77,14 +77,13 @@ class RepoTemp(object):
 
    def __repr__(self):
 
        return "<%s('id:%s')>" % (self.__class__.__name__, self.repo_id)
 

	
 

	
 
class CachedRepoList(object):
 
    """
 
    Cached repo list, uses in-memory cache after initialization, that is
 
    super fast
 
    Cached repo list. Uses super-fast in-memory cache after initialization.
 
    """
 

	
 
    def __init__(self, db_repo_list, repos_path, order_by=None, perm_set=None):
 
        self.db_repo_list = db_repo_list
 
        self.repos_path = repos_path
 
        self.order_by = order_by
 
@@ -577,14 +576,13 @@ class ScmModel(BaseModel):
 
        if f_path:
 
            f_path = os.path.normpath(f_path)
 
        return f_path
 

	
 
    def get_nodes(self, repo_name, revision, root_path='/', flat=True):
 
        """
 
        recursive walk in root dir and return a set of all path in that dir
 
        based on repository walk function
 
        Recursively walk root dir and return a set of all paths found.
 

	
 
        :param repo_name: name of repository
 
        :param revision: revision for which to list nodes
 
        :param root_path: root path to list
 
        :param flat: return as a list, if False returns a dict with description
 

	
 
@@ -608,13 +606,13 @@ class ScmModel(BaseModel):
 

	
 
        return _dirs, _files
 

	
 
    def create_nodes(self, user, repo, message, nodes, parent_cs=None,
 
                     author=None, trigger_push_hook=True):
 
        """
 
        Commits given multiple nodes into repo
 
        Commits specified nodes to repo.
 

	
 
        :param user: Kallithea User object or user_id, the commiter
 
        :param repo: Kallithea Repository object
 
        :param message: commit message
 
        :param nodes: mapping {filename:{'content':content},...}
 
        :param parent_cs: parent changeset, can be empty than it's initial commit
 
@@ -733,13 +731,13 @@ class ScmModel(BaseModel):
 
                              repo_name=repo.repo_name,
 
                              revisions=[tip.raw_id])
 

	
 
    def delete_nodes(self, user, repo, message, nodes, parent_cs=None,
 
                     author=None, trigger_push_hook=True):
 
        """
 
        Deletes given multiple nodes into repo
 
        Deletes specified nodes from repo.
 

	
 
        :param user: Kallithea User object or user_id, the commiter
 
        :param repo: Kallithea Repository object
 
        :param message: commit message
 
        :param nodes: mapping {filename:{'content':content},...}
 
        :param parent_cs: parent changeset, can be empty than it's initial commit
0 comments (0 inline, 0 general)