Changeset - 69b836e383df
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-05-22 20:35:54
marcin@python-works.com
don't disable .git directory for bare repos on deleting, ref #413
1 file changed with 8 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/repo.py
Show inline comments
 
@@ -490,14 +490,19 @@ class RepoModel(BaseModel):
 
        by reverting the renames on this repository
 

	
 
        :param repo: repo object
 
        """
 
        rm_path = os.path.join(self.repos_path, repo.repo_name)
 
        log.info("Removing %s" % (rm_path))
 
        # disable hg/git
 
        # disable hg/git internal that it doesn't get detected as repo
 
        alias = repo.repo_type
 
        shutil.move(os.path.join(rm_path, '.%s' % alias),
 
                    os.path.join(rm_path, 'rm__.%s' % alias))
 

	
 
        bare = getattr(repo.scm_instance, 'bare', False)
 

	
 
        if not bare:
 
            # skip this for bare git repos
 
            shutil.move(os.path.join(rm_path, '.%s' % alias),
 
                        os.path.join(rm_path, 'rm__.%s' % alias))
 
        # disable repo
 
        _d = 'rm__%s__%s' % (datetime.now().strftime('%Y%m%d_%H%M%S_%f'),
 
                             repo.repo_name)
 
        shutil.move(rm_path, os.path.join(self.repos_path, _d))
0 comments (0 inline, 0 general)