Changeset - bf0a587334ea
[Not reviewed]
default
0 1 0
Mads Kiilerich - 9 years ago 2016-06-10 01:19:58
madski@unity3d.com
repo: better handling of situation where there is no repo to remove

Change internal method _delete_filesystem_repo. We should never end up in such
situations, but this helps debugging if it should happen.
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/model/repo.py
Show inline comments
 
@@ -771,7 +771,10 @@ class RepoModel(BaseModel):
 
        _ms = str(_now.microsecond).rjust(6, '0')
 
        _d = 'rm__%s__%s' % (_now.strftime('%Y%m%d_%H%M%S_' + _ms),
 
                             repo.just_name)
 
        if repo.group:
 
            args = repo.group.full_path_splitted + [_d]
 
            _d = os.path.join(*args)
 
        shutil.move(rm_path, safe_str(os.path.join(self.repos_path, _d)))
 
        if os.path.exists(rm_path):
 
            shutil.move(rm_path, safe_str(os.path.join(self.repos_path, _d)))
 
        else:
 
            log.error("Can't find repo to delete in %r", rm_path)
0 comments (0 inline, 0 general)