Changeset 79

Show
Ignore:
Timestamp:
2009年03月13日 16时59分39秒 (3 years ago)
Author:
jiangx
Message:

Fixed #20: Use os.path.islink instead of os.path.isdir fixed this issue.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pysvnmanager/model/repos.py

    r76 r79  
    105105        if os.path.exists(dest): 
    106106            assert os.path.basename(dest) == 'hooks' 
    107             if os.path.isdir(dest): 
     107            if os.path.islink(dest): 
     108                os.unlink(dest) 
     109            else: 
    108110                shutil.rmtree(dest) 
    109             else: 
    110                 os.unlink(dest) 
    111111        elif not os.path.exists(os.path.dirname(dest)): 
    112112            raise Exception("Destination repository '%s' not exist!" % os.path.dirname(dest)) 
     
    136136        if os.path.exists(dest): 
    137137            assert os.path.basename(dest) == 'hooks' 
    138             if os.path.isdir(dest): 
     138            if os.path.islink(dest): 
     139                os.unlink(dest) 
     140            else: 
    139141                shutil.rmtree(dest) 
    140             else: 
    141                 os.unlink(dest) 
    142142        elif not os.path.exists(os.path.dirname(dest)): 
    143143            raise Exception("Destination repository '%s' not exist!" % os.path.dirname(dest))