forked from charleso/git-cc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync.py
More file actions
19 lines (17 loc) · 691 Bytes
/
sync.py
File metadata and controls
19 lines (17 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""Copy files from Clearcase to Git manually"""
from common import *
import os, shutil, stat
from os.path import join, abspath
from fnmatch import fnmatch
def main(glob):
base = abspath(CC_DIR)
for i in cfg.getList('include', '.'):
for (dirpath, dirnames, filenames) in os.walk(join(CC_DIR, i)):
reldir = dirpath[len(base)+1:]
for file in filenames:
if fnmatch(file, glob):
newFile = join(GIT_DIR, reldir, file)
debug('Copying %s' % newFile)
mkdirs(newFile)
shutil.copy(join(dirpath, file), newFile)
os.chmod(newFile, stat.S_IWRITE)