读书人

pysvn操作svn解决方案

发布时间: 2012-03-01 10:25:47 作者: rapoo

pysvn操作svn

Python code
def cover_file(originitems, destitems, odir, ddir, client):    updateitems = []    additems = []    for item in originitems:        fpath = ddir + item        dir = os.path.dirname(fpath)        if not os.path.exists(dir):            os.makedirs(dir)        if item in destitems and os.path.exists(fpath):            os.remove(fpath)            file(fpath, 'wb').write(file(odir + item).read())            updateitems.append(fpath)        elif item not in destitems:            file(fpath, 'wb').write(file(odir + item).read())            additems.append(fpath)    if len(updateitems) > 0:        client.checkin(updateitems, '')    if len(additems) > 0:        client.add(ddir,force=True)

======================

我这pysvn调用得对吗....


[解决办法]
自己测试过了吗?

读书人网 >perl python

热点推荐