Changeset - cb733c39f658
[Not reviewed]
default
0 1 0
Mads Kiilerich (mads) - 5 years ago 2021-04-21 14:48:53
mads@kiilerich.com
Grafted from: ebb629c54eee
db: read hgrc in Repository.scm_instance_no_cache and Gist.scm_instance

This will make sure .hg/hgrc is read in some code paths where it was missing.
That might make a difference in some real world cases.
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/model/db.py
Show inline comments
 
@@ -1314,13 +1314,13 @@ class Repository(meta.Base, BaseDbModel)
 
        return self._scm_instance
 

	
 
    def scm_instance_no_cache(self):
 
        repo_full_path = self.repo_full_path
 
        log.debug('Creating instance of repository at %s', repo_full_path)
 
        from kallithea.lib.utils import make_ui
 
        self._scm_instance = get_repo(repo_full_path, baseui=make_ui())
 
        self._scm_instance = get_repo(repo_full_path, baseui=make_ui(repo_full_path))
 
        return self._scm_instance
 

	
 
    def __json__(self):
 
        return dict(
 
            repo_id=self.repo_id,
 
            repo_name=self.repo_name,
 
@@ -2238,13 +2238,15 @@ class Gist(meta.Base, BaseDbModel):
 

	
 
    ## SCM functions
 

	
 
    @property
 
    def scm_instance(self):
 
        gist_base_path = os.path.join(kallithea.CONFIG['base_path'], self.GIST_STORE_LOC)
 
        return get_repo(os.path.join(gist_base_path, self.gist_access_id))
 
        repo_full_path = os.path.join(gist_base_path, self.gist_access_id)
 
        from kallithea.lib.utils import make_ui
 
        return get_repo(repo_full_path, baseui=make_ui(repo_full_path))
 

	
 

	
 
class UserSshKeys(meta.Base, BaseDbModel):
 
    __tablename__ = 'user_ssh_keys'
 
    __table_args__ = (
 
        Index('usk_fingerprint_idx', 'fingerprint'),
0 comments (0 inline, 0 general)